chiark / gitweb /
test suite: Drop alwayssplit tests
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 3afaf193a4127e320ce611162b9f5f896086350f..5d7d8d7a13ea2f14a39290d71932b65cffd730b0 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4756,10 +4756,14 @@ sub cmd_push {
     dopush();
 }
 
+our $sourcechanges;
+
 sub cmd_push_source {
     prep_push();
     fail "dgit push-source: --include-dirty/--ignore-dirty does not make".
       "sense with push-source!" if $includedirty;
+    clean_tree();
+    build_maybe_quilt_fixup();
     if ($changesfile) {
         my $changes = parsecontrol("$buildproductsdir/$changesfile",
                                    "source changes file");
@@ -4768,7 +4772,10 @@ sub cmd_push_source {
         }
     } else {
         # Building a source package is very fast, so just do it
-        build_source_for_push();
+       build_source();
+       die "er, patches are applied dirtily but shouldn't be.."
+           if $patches_applied_dirtily;
+       $changesfile = $sourcechanges;
     }
     dopush();
 }
@@ -5062,7 +5069,6 @@ sub i_want_signed_dsc_changes {
 #---------- building etc. ----------
 
 our $version;
-our $sourcechanges;
 our $dscfn;
 
 #----- `3.0 (quilt)' handling -----
@@ -6128,7 +6134,8 @@ sub build_prep_early () {
     check_not_dirty();
 }
 
-sub build_prep () {
+sub build_prep ($) {
+    my ($wantsrc) = @_;
     build_prep_early();
     clean_tree();
     build_maybe_quilt_fixup();
@@ -6317,11 +6324,10 @@ sub cmd_build {
     build_prep_early();
     my @dbp = (@dpkgbuildpackage, qw(-us -uc), changesopts_initial(), @ARGV);
     my $wantsrc = massage_dbp_args \@dbp;
+    build_prep($wantsrc);
     if ($wantsrc & WANTSRC_SOURCE) {
        build_source();
        midbuild_checkchanges_vanilla $wantsrc;
-    } else {
-       build_prep();
     }
     if ($wantsrc & WANTSRC_BUILDER) {
        push @dbp, changesopts_version();
@@ -6390,6 +6396,7 @@ sub cmd_gbp_build {
        }
     }
 
+    build_prep($wantsrc);
     if ($wantsrc & WANTSRC_SOURCE) {
        build_source();
        midbuild_checkchanges_vanilla $wantsrc;
@@ -6397,7 +6404,6 @@ sub cmd_gbp_build {
        if (!$clean_using_builder) {
            push @cmd, '--git-cleaner=true';
        }
-       build_prep();
     }
     maybe_unapply_patches_again();
     if ($wantsrc & WANTSRC_BUILDER) {
@@ -6408,15 +6414,7 @@ sub cmd_gbp_build {
 }
 sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0
 
-sub build_source_for_push {
-    build_source();
-    maybe_unapply_patches_again();
-    $changesfile = $sourcechanges;
-}
-
 sub build_source {
-    build_prep_early();
-    build_prep();
     $sourcechanges = changespat $version,'source';
     if (act_local()) {
        unlink "$buildproductsdir/$sourcechanges" or $!==ENOENT
@@ -6453,14 +6451,15 @@ sub build_source {
 }
 
 sub cmd_build_source {
-    build_prep_early();
     badusage "build-source takes no additional arguments" if @ARGV;
+    build_prep(WANTSRC_SOURCE);
     build_source();
     maybe_unapply_patches_again();
     printdone "source built, results in $dscfn and $sourcechanges";
 }
 
 sub cmd_sbuild {
+    build_prep(WANTSRC_SOURCE); # not BUILDER because sbuild uses the .dsc
     build_source();
     midbuild_checkchanges();
     in_bpd {
@@ -6914,7 +6913,7 @@ sub parseopts () {
                $tagformat_want = [ $1, 'command line', 1 ];
                # 1 menas overrides distro configuration
            } elsif (m/^--always-split-source-build$/s) {
-               # undocumented, for testing
+               # undocumented, was once for testing, now a no-op
                push @ropts, $_;
                $need_split_build_invocation = 1;
            } elsif (m/^--config-lookup-explode=(.+)$/s) {