From b24b60a4cc84fe61b86844c2f670435c78548112 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 4 Aug 2017 10:03:44 -0400 Subject: dgit: build_source bypasses dpkg-buildpackage This is to avoid the inclusion of .buildinfo in the .changes. Quoting : A .buildinfo file is not useful for a source-only upload which is veried to be identical to the intended source as present in the uploader's version control (eg, by the use of dgit). Signed-off-by: Sean Whitton Acked-by: Ian Jackson --- dgit | 73 +++++++++++++++++++++++--------------------------------------------- 1 file changed, 25 insertions(+), 48 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index 31e6bd5..3920d86 100755 --- a/dgit +++ b/dgit @@ -6145,19 +6145,6 @@ sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0 sub build_source { build_prep_early(); - my $our_cleanmode = $cleanmode; - if ($need_split_build_invocation) { - # Pretend that clean is being done some other way. This - # forces us not to try to use dpkg-buildpackage to clean and - # build source all in one go; and instead we run dpkg-source - # (and build_prep() will do the clean since $clean_using_builder - # is false). - $our_cleanmode = 'ELSEWHERE'; - } - if ($our_cleanmode =~ m/^dpkg-source/) { - # dpkg-source invocation (below) will clean, so build_prep shouldn't - $clean_using_builder = 1; - } build_prep(); $sourcechanges = changespat $version,'source'; if (act_local()) { @@ -6165,43 +6152,33 @@ sub build_source { or fail "remove $sourcechanges: $!"; } $dscfn = dscfn($version); - if ($our_cleanmode eq 'dpkg-source') { - maybe_apply_patches_dirtily(); - runcmd_ordryrun_local @dpkgbuildpackage, qw(-us -uc -S), - changesopts(); - } elsif ($our_cleanmode eq 'dpkg-source-d') { - maybe_apply_patches_dirtily(); - runcmd_ordryrun_local @dpkgbuildpackage, qw(-us -uc -S -d), - changesopts(); + my @cmd = (@dpkgsource, qw(-b --)); + if ($split_brain) { + changedir $playground; + runcmd_ordryrun_local @cmd, "work"; + my @udfiles = <${package}_*>; + changedir $maindir; + foreach my $f (@udfiles) { + printdebug "source copy, found $f\n"; + next unless + $f eq $dscfn or + ($f =~ m/\.debian\.tar(?:\.\w+)$/ && + $f eq srcfn($version, $&)); + printdebug "source copy, found $f - renaming\n"; + rename "$playground/$f", "../$f" or $!==ENOENT + or fail "put in place new source file ($f): $!"; + } } else { - my @cmd = (@dpkgsource, qw(-b --)); - if ($split_brain) { - changedir $playground; - runcmd_ordryrun_local @cmd, "work"; - my @udfiles = <${package}_*>; - changedir $maindir; - foreach my $f (@udfiles) { - printdebug "source copy, found $f\n"; - next unless - $f eq $dscfn or - ($f =~ m/\.debian\.tar(?:\.\w+)$/ && - $f eq srcfn($version, $&)); - printdebug "source copy, found $f - renaming\n"; - rename "$playground/$f", "../$f" or $!==ENOENT - or fail "put in place new source file ($f): $!"; - } - } else { - my $pwd = must_getcwd(); - my $leafdir = basename $pwd; - changedir ".."; - runcmd_ordryrun_local @cmd, $leafdir; - changedir $pwd; - } - runcmd_ordryrun_local qw(sh -ec), - 'exec >$1; shift; exec "$@"','x', - "../$sourcechanges", - @dpkggenchanges, qw(-S), changesopts(); + my $pwd = must_getcwd(); + my $leafdir = basename $pwd; + changedir ".."; + runcmd_ordryrun_local @cmd, $leafdir; + changedir $pwd; } + runcmd_ordryrun_local qw(sh -ec), + 'exec >$1; shift; exec "$@"','x', + "../$sourcechanges", + @dpkggenchanges, qw(-S), changesopts(); } sub cmd_build_source { -- cgit v1.2.3