chiark / gitweb /
dgit: factor out build_with_binary_builder()
authorSean Whitton <spwhitton@spwhitton.name>
Fri, 27 Jul 2018 04:08:53 +0000 (12:08 +0800)
committerSean Whitton <spwhitton@spwhitton.name>
Sat, 28 Jul 2018 04:12:05 +0000 (12:12 +0800)
The pbuilder and cowbuilder subcommands will reuse this code.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
dgit

diff --git a/dgit b/dgit
index 3d9e5f68fe907ddde2f7df4213faee264859eb70..031380c52e8ef51853d4c4871b694c3dcab89f16 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6492,7 +6492,16 @@ sub cmd_push_source {
 }
 
 sub cmd_sbuild {
-    build_prep(WANTSRC_SOURCE); # not BUILDER because sbuild uses the .dsc
+    build_prep_early();
+    build_with_binary_builder(\@sbuild, <<END, qw(-d), $isuite, @ARGV, $dscfn);
+perhaps you need to pass -A ?  (sbuild's default is to build only
+arch-specific binaries; dgit 1.4 used to override that.)
+END
+}
+
+sub build_with_binary_builder ($$$) {
+    my ($bbuilder, $pbmc_msg, @args) = @_;
+    build_prep(WANTSRC_SOURCE);
     build_source();
     midbuild_checkchanges();
     in_bpd {
@@ -6501,16 +6510,13 @@ sub cmd_sbuild {
            stat_exists $sourcechanges
                or fail "$sourcechanges (in build products dir): $!";
        }
-       runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @ARGV, $dscfn;
+       runcmd_ordryrun_local @$bbuilder, @args;
     };
     maybe_unapply_patches_again();
     in_bpd {
-       postbuild_mergechanges(<<END);
-perhaps you need to pass -A ?  (sbuild's default is to build only
-arch-specific binaries; dgit 1.4 used to override that.)
-END
+       postbuild_mergechanges($pbmc_msg);
     };
-}    
+}
 
 sub cmd_quilt_fixup {
     badusage "incorrect arguments to dgit quilt-fixup" if @ARGV;