chiark / gitweb /
dgit build: Better message when network is offline.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 20 Jun 2018 17:30:50 +0000 (18:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 20 Jun 2018 22:51:22 +0000 (23:51 +0100)
When build fails because the archive access fails, mention that this
was tried because --since-version was not specified.

Closes:#883340.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit

index 4be989d..68ec24e 100644 (file)
@@ -2,6 +2,11 @@ dgit (5.2~) unstable; urgency=medium
 
   * dgit(1): Mention under `dgit build' that it uses the network.
 
+  dgit:
+  * When build fails because the network is offline, mention
+    that this is because --since-version was not specified.
+    Closes:#883340.
+
  --
 
 dgit (5.1) unstable; urgency=medium
diff --git a/dgit b/dgit
index 2cf78ec..9084eaf 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6018,13 +6018,21 @@ sub changesopts_initial () {
 
 sub changesopts_version () {
     if (!defined $changes_since_version) {
-       my @vsns = archive_query('archive_query');
-       my @quirk = access_quirk();
-       if ($quirk[0] eq 'backports') {
-           local $isuite = $quirk[2];
-           local $csuite;
-           canonicalise_suite();
-           push @vsns, archive_query('archive_query');
+       my @vsns;
+       unless (eval {
+           @vsns = archive_query('archive_query');
+           my @quirk = access_quirk();
+           if ($quirk[0] eq 'backports') {
+               local $isuite = $quirk[2];
+               local $csuite;
+               canonicalise_suite();
+               push @vsns, archive_query('archive_query');
+           }
+           1;
+       }) {
+           print STDERR $@;
+           fail
+ "archive query failed (queried because --since-version not specified)";
        }
        if (@vsns) {
            @vsns = map { $_->[0] } @vsns;