printdone "source built, results in $dscfn and $sourcechanges";
}
-sub cmd_sbuild {
+sub external_binbuilder (&$) {
+ my ($fn, $postbuild_msg) = @_;
build_source();
midbuild_checkchanges();
in_parent {
stat_exists $dscfn or fail "$dscfn (in parent directory): $!";
stat_exists $sourcechanges
or fail "$sourcechanges (in parent directory): $!";
+ $fn->();
}
- runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @ARGV, $dscfn;
};
maybe_unapply_patches_again();
in_parent {
- postbuild_mergechanges(<<END);
+ postbuild_mergechanges $postbuild_msg;
+ };
+}
+
+sub cmd_sbuild {
+ external_binbuilder {
+ runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @ARGV, $dscfn;
+ }, <<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
- };
+}
+
+our $pbuild_opt;
+our $pbuild_arg;
+
+sub pb_arg_val ($) {
+ my ($r) = @_;
+ if (m/^$r$/) {
+ badusage "missing value for pbuilder option $_" unless @ARGV;
+ $pbuild_opt = $&;
+ $pbuild_arg = shift @ARGV;
+ return 1;
+ }
+ if (m/^($r)=/) {
+ $pbuild_opt = $1;
+ $pbuild_arg = $';
+ return 1;
+ }
+ return 0;
+}
+
+sub cmd_pbuild {
+ my $ar = qr{(?:=(.*))?$};
+ while (@ARGV) {
+ $_ = shift @ARGV;
+ if (m/^--/) {
+ if (pb_arg_val qr{basetgz|buildplace}) {
+ push @pb_opts, $pbuild_opt, $pbuild_arg;
+ } elsif (m/^--buildresult$ar/o) {
+ $buildproductsdir //= $pbuild_arg;
+ }
+
+ external_binbuilder {
+ runcmd_ordryrun_local @sbuild, qw(-d), $isuite, @pbuild_opts, $dscfn;
+ }, "";
}
sub cmd_quilt_fixup {