From 1ca959f4e5d5452052ca2abb7dfaf29c958f43c7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Dec 2015 20:12:20 +0000 Subject: [PATCH] Split build: Split clean from source build in split build mode --- dgit | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dgit b/dgit index 4d31cd60..9763bbfd 100755 --- a/dgit +++ b/dgit @@ -3415,8 +3415,17 @@ sub cmd_gbp_build { sub cmd_git_build { cmd_gbp_build(); } # compatibility with <= 1.0 sub build_source { - if ($cleanmode =~ m/^dpkg-source/) { - # dpkg-source will clean, so we shouldn't + 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(); @@ -3426,12 +3435,12 @@ sub build_source { or fail "remove $sourcechanges: $!"; } $dscfn = dscfn($version); - if ($cleanmode eq 'dpkg-source') { + if ($our_cleanmode eq 'dpkg-source') { runcmd_ordryrun_local @dpkgbuildpackage, qw(-us -uc -S), - changesopts(); - } elsif ($cleanmode eq 'dpkg-source-d') { + changesopts(); + } elsif ($our_cleanmode eq 'dpkg-source-d') { runcmd_ordryrun_local @dpkgbuildpackage, qw(-us -uc -S -d), - changesopts(); + changesopts(); } else { my $pwd = must_getcwd(); my $leafdir = basename $pwd; -- 2.30.2