From: Ian Jackson Date: Wed, 25 Jul 2018 13:59:27 +0000 (+0100) Subject: dgit: massage_dbp_args: Make names for $wantsrc values X-Git-Tag: archive/debian/6.0~33 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c967edb8b4e33f1d3f7c2b829ab43fbea4a5e17c;p=dgit.git dgit: massage_dbp_args: Make names for $wantsrc values 0 - source will NOT need to be built separately by caller +1 - source will need to be built separately by caller +2 - source will need to be built separately by caller AND So: 0 => WANTSRC_BUILDER +1 => WANTSRC_SOURCE | WANTSRC_BUILDER +2 => WANTSRC_SOURCE No functional change except to debugging output. Signed-off-by: Ian Jackson --- diff --git a/dgit b/dgit index a5470d4d..7c63b86f 100755 --- a/dgit +++ b/dgit @@ -6179,6 +6179,10 @@ sub changesopts () { return (changesopts_initial(), changesopts_version()); } +# return values from massage_dbp_args are one or both of these flags +sub WANTSRC_SOURCE () { 01; } # caller should build source (separately) +sub WANTSRC_BUILDER () { 02; } # caller should run dpkg-buildpackage + sub massage_dbp_args ($;$) { my ($cmd,$xargs) = @_; # We need to: @@ -6192,16 +6196,11 @@ sub massage_dbp_args ($;$) { # unless we're not doing a split build and want dpkg-source # as cleanmode, in which case we can do nothing # - # return values: - # 0 - source will NOT need to be built separately by caller - # +1 - source will need to be built separately by caller - # +2 - source will need to be built separately by caller AND - # dpkg-buildpackage should not in fact be run at all! debugcmd '#massaging#', @$cmd if $debuglevel>1; #print STDERR "MASS0 ",Dumper($cmd, $xargs, $need_split_build_invocation); if ($cleanmode eq 'dpkg-source' && !$need_split_build_invocation) { $clean_using_builder = 1; - return 0; + return WANTSRC_BUILDER; } # -nc has the side effect of specifying -b if nothing else specified # and some combinations of -S, -b, et al, are errors, rather than @@ -6217,12 +6216,12 @@ sub massage_dbp_args ($;$) { } push @$cmd, '-nc'; #print STDERR "MASS1 ",Dumper($cmd, $xargs, $dmode); - my $r = 0; + my $r = WANTSRC_BUILDER; if ($need_split_build_invocation) { printdebug "massage split $dmode.\n"; - $r = $dmode =~ m/[S]/ ? +2 : - $dmode =~ y/gGF/ABb/ ? +1 : - $dmode =~ m/[ABb]/ ? 0 : + $r = $dmode =~ m/[S]/ ? WANTSRC_SOURCE : + $dmode =~ y/gGF/ABb/ ? WANTSRC_SOURCE | WANTSRC_BUILDER : + $dmode =~ m/[ABb]/ ? WANTSRC_BUILDER : die "$dmode ?"; } printdebug "massage done $r $dmode.\n"; @@ -6293,12 +6292,12 @@ END sub midbuild_checkchanges_vanilla ($) { my ($wantsrc) = @_; - midbuild_checkchanges() if $wantsrc == 1; + midbuild_checkchanges() if $wantsrc == (WANTSRC_SOURCE|WANTSRC_BUILDER); } sub postbuild_mergechanges_vanilla ($) { my ($wantsrc) = @_; - if ($wantsrc == 1) { + if ($wantsrc == (WANTSRC_SOURCE|WANTSRC_BUILDER)) { in_bpd { postbuild_mergechanges(undef); }; @@ -6311,13 +6310,13 @@ sub cmd_build { build_prep_early(); my @dbp = (@dpkgbuildpackage, qw(-us -uc), changesopts_initial(), @ARGV); my $wantsrc = massage_dbp_args \@dbp; - if ($wantsrc > 0) { + if ($wantsrc & WANTSRC_SOURCE) { build_source(); midbuild_checkchanges_vanilla $wantsrc; } else { build_prep(); } - if ($wantsrc < 2) { + if ($wantsrc & WANTSRC_BUILDER) { push @dbp, changesopts_version(); maybe_apply_patches_dirtily(); runcmd_ordryrun_local @dbp; @@ -6384,7 +6383,7 @@ sub cmd_gbp_build { } } - if ($wantsrc > 0) { + if ($wantsrc & WANTSRC_SOURCE) { build_source(); midbuild_checkchanges_vanilla $wantsrc; } else { @@ -6394,7 +6393,7 @@ sub cmd_gbp_build { build_prep(); } maybe_unapply_patches_again(); - if ($wantsrc < 2) { + if ($wantsrc & WANTSRC_BUILDER) { push @cmd, changesopts(); runcmd_ordryrun_local @cmd, @ARGV; }