chiark / gitweb /
quilt-fixup checks that the git tree is clean, as for build-prep.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index a49c7667e611c577e70cd48f75ff122e277a62be..e02a6bd267fc506b224c9abb2db9f6aa7b9749e1 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1751,7 +1751,14 @@ sub pull () {
 }
 
 sub check_not_dirty () {
+    foreach my $f (qw(local-options local-patch-header)) {
+       if (stat_exists "debian/source/$f") {
+           fail "git tree contains debian/source/$f";
+       }
+    }
+
     return if $ignoredirty;
+
     my @cmd = (@git, qw(diff --quiet HEAD));
     debugcmd "+",@cmd;
     $!=0; $?=0; system @cmd;
@@ -1761,12 +1768,6 @@ sub check_not_dirty () {
     } else {
        failedcmd @cmd;
     }
-
-    foreach my $f (qw(local-options local-patch-header)) {
-       if (stat_exists "debian/source/$f") {
-           fail "git tree contains debian/source/$f";
-       }
-    }
 }
 
 sub commit_admin ($) {
@@ -2800,6 +2801,8 @@ sub quilt_fixup_delete_pc () {
 sub quilt_fixup_singlepatch ($$$) {
     my ($clogp, $headref, $upstreamversion) = @_;
 
+    progress "starting quiltify (single-debian-patch)";
+
     # dpkg-source --commit generates new patches even if
     # single-debian-patch is in debian/source/options.  In order to
     # get it to generate debian/patches/debian-changes, it is
@@ -2825,6 +2828,8 @@ sub quilt_fixup_singlepatch ($$$) {
 sub quilt_fixup_multipatch ($$$) {
     my ($clogp, $headref, $upstreamversion) = @_;
 
+    progress "starting quiltify (multiple patches, $quilt_mode mode)";
+
     # Our objective is:
     #  - honour any existing .pc in case it has any strangeness
     #  - determine the git commit corresponding to the tip of
@@ -3135,7 +3140,7 @@ sub cmd_sbuild {
            unlink $cf or fail "remove $cf: $!";
        }
     }
-    runcmd_ordryrun_local @sbuild, @ARGV, qw(-d), $isuite, $dscfn;
+    runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @ARGV, $dscfn;
     my @changesfiles = glob $pat;
     @changesfiles = sort {
        ($b =~ m/_source\.changes$/ <=> $a =~ m/_source\.changes$/)
@@ -3156,6 +3161,8 @@ sub cmd_quilt_fixup {
     my $clogp = parsechangelog();
     $version = getfield $clogp, 'Version';
     $package = getfield $clogp, 'Source';
+    check_not_dirty();
+    clean_tree();
     build_maybe_quilt_fixup();
 }