chiark / gitweb /
dgit: warn if vcs-git seems out of date
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2018 13:11:10 +0000 (14:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2018 16:19:45 +0000 (17:19 +0100)
Print a warning to stderr on `dgit fetch sid', if your vcs-git remote
url disagrees with what's in sid's .dsc.

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

index 6bc61735c3b727421dc440bd2edeb1e67d9bfc8e..2efcc9cc258ff13a33b61fcb0b573dc6f46cf407 100644 (file)
@@ -24,6 +24,8 @@ dgit (5.2~) unstable; urgency=medium
   * Provide `update-vcs-git' subcommand, for creating and adjusting the
     vcs-git remote url.  Useful for transition from alioth to salsa.
     Closes:#902006.
+  * Print a warning to stderr on `dgit fetch sid', if your vcs-git
+    remote url disagrees with what's in sid's .dsc.
 
   test suite:
   * Use nproc(1) rather than Sys::CPU.  This is more portable and does not
diff --git a/dgit b/dgit
index 48fd4f487707be2c992e2dfaad56f0caac50e30c..2365bfce431b45869c07f650f2d398e7f01ed763 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3722,6 +3722,20 @@ sub fetch () {
        git_fetch_us();
     }
     fetch_from_archive() or no_such_package();
+    
+    my $vcsgiturl = $dsc && $dsc->{'Vcs-Git'};
+    if (length $vcsgiturl and
+       (grep { $csuite eq $_ }
+        split /\;/,
+        cfg 'dgit.vcs-git.suites')) {
+       my $current = cfg 'remote.vcs-git.url', 'RETURN-UNDEF';
+       if (defined $current && $current ne $vcsgiturl) {
+           print STDERR <<END;
+FYI: Vcs-Git in $csuite has different url to your vcs-git remote.
+ Your vcs-git remote url may be out of date.  Use dgit update-vcs-git ?
+END
+       }
+    }
     printdone "fetched into ".lrref();
 }