chiark / gitweb /
Better checking that the supplied .dsc and debian/changes correspond.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 12:20:58 +0000 (13:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Aug 2013 12:20:58 +0000 (13:20 +0100)
debian/changelog
dgit

index 328c744e1a69468cebe1a3bbd904913ab3c4221c..dc9e5ab27cf74679627a62f7d6665d96afd20387 100644 (file)
@@ -6,6 +6,7 @@ dgit (0.4) experimental; urgency=low
   * Fail if a required config item is missing.
   * Much better error messages.
   * Better error checking when parsing RFC822-style control data.
   * Fail if a required config item is missing.
   * Much better error messages.
   * Better error checking when parsing RFC822-style control data.
+  * Better checking that the supplied .dsc and debian/changes correspond.
 
  --
 
 
  --
 
diff --git a/dgit b/dgit
index b136ed98a81ed45a5b96eac0ff5815992ec3bd87..fcc792d6cc432619e2fd93c83a412612a50e134a 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -724,8 +724,12 @@ sub dopush () {
        fail "looked for .dsc $dscfn, but $!;".
            " maybe you forgot to build";
     $dsc = parsecontrol("../$dscfn","$dscfn");
        fail "looked for .dsc $dscfn, but $!;".
            " maybe you forgot to build";
     $dsc = parsecontrol("../$dscfn","$dscfn");
+    my $dscpackage = getfield $dsc, 'Source';
     my $format = getfield $dsc, 'Format';
     my $dversion = getfield $dsc, 'Version';
     my $format = getfield $dsc, 'Format';
     my $dversion = getfield $dsc, 'Version';
+    ($dscpackage eq $package && $dversion eq $cversion)
+       fail "$dsc is for $dscpackage $dversion".
+           " but debian/changelog is for $package $cversion";
     print DEBUG "format $format\n";
     if ($format eq '3.0 (quilt)') {
        print "Format \`$format', urgh\n";
     print DEBUG "format $format\n";
     if ($format eq '3.0 (quilt)') {
        print "Format \`$format', urgh\n";