chiark / gitweb /
dgit --overwrite: Check $gf->('Distribution')
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 25 Jan 2017 15:44:42 +0000 (15:44 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 25 Jan 2017 15:44:43 +0000 (15:44 +0000)
Check that the overwritten version's changelog entry is not
UNRELEASED.

This could easily happen if this release was being made from a git
branch which predates the previous package upload, with working
practices which commit finalised UNRELEASED changelog entries with the
complete version number for the next upload.  (Such practices seem
quite common.)

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

index 49464d8907fcd6309d2a4ca3b610d62643370d78..d5bef7be10d6b6ec29b7c80782431a1dbe7f8765 100644 (file)
@@ -1,6 +1,9 @@
 dgit (3.9~) unstable; urgency=medium
 
-  * 
+  Improvements:
+  * dgit --overwrite: Check that the overwritten version's changelog entry
+    is not UNRELEASED.  This could easily happen if this release was being
+    made from a git branch which predates the previous package upload.
 
  --
 
diff --git a/dgit b/dgit
index af14e3f9183c3984374b79e874242b293e48b5ff..9cdf96b5226d80c378ec6f69eed37ad26b4f3e25 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -3799,6 +3799,7 @@ sub pseudomerge_version_check ($$) {
        } else {
            my $v = $i_arch_v->[0];
            progress "Checking package changelog for archive version $v ...";
+           my $cd;
            eval {
                my @xa = ("-f$v", "-t$v");
                my $vclogp = parsechangelog @xa;
@@ -3809,12 +3810,17 @@ sub pseudomerge_version_check ($$) {
                };
                my $cv = $gf->('Version');
                infopair_cond_equal($i_arch_v, $cv);
+               $cd = $gf->('Distribution');
            };
            if ($@) {
                $@ =~ s/^dgit: //gm;
                fail "$@".
                    "Perhaps debian/changelog does not mention $v ?";
            }
+           fail <<END if $cd->[0] =~ m/UNRELEASED/;
+$cd->[1] is $cd->[0]
+Your tree seems to based on earlier (not uploaded) $v.
+END
        }
     }