X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=7752d824f6c30023304ac8a0716d84f67d41a2eb;hb=5dbf5d3d2ef07b059c732abe77d1657e3fc3f714;hp=5b99ed1cde43acf7e58f89886542bda82fd0005f;hpb=95cce6041df774f7909b28c110417881f1d4792a;p=dgit.git diff --git a/dgit b/dgit index 5b99ed1c..7752d824 100755 --- a/dgit +++ b/dgit @@ -1793,9 +1793,21 @@ sub quilt_fixup_editor () { exit 0; } +sub clean_tree () { + if ($cleanmode eq 'dpkg-source') { + runcmd_ordryrun_local @dpkgbuildpackage, qw(-T clean); + } elsif ($cleanmode eq 'git') { + runcmd_ordryrun_local @git, qw(clean -xdf); + } elsif ($cleanmode eq 'none') { + } else { + die "$cleanmode ?"; + } +} + sub build_prep () { badusage "-p is not allowed when building" if defined $package; check_not_dirty(); + clean_tree(); my $clogp = parsechangelog(); $isuite = getfield $clogp, 'Distribution'; $package = getfield $clogp, 'Source'; @@ -1824,16 +1836,12 @@ sub changesopts () { } sub cmd_build { - badusage "dgit build implies --clean=dpkg-source" - if $cleanmode ne 'dpkg-source'; build_prep(); runcmd_ordryrun_local @dpkgbuildpackage, qw(-us -uc), changesopts(), @ARGV; printdone "build successful\n"; } sub cmd_git_build { - badusage "dgit git-build implies --clean=dpkg-source" - if $cleanmode ne 'dpkg-source'; build_prep(); my @cmd = (qw(git-buildpackage -us -uc --git-no-sign-tags), @@ -1855,12 +1863,6 @@ sub build_source { runcmd_ordryrun_local (@dpkgbuildpackage, qw(-us -uc -S)), changesopts(); } else { - if ($cleanmode eq 'git') { - runcmd_ordryrun_local @git, qw(clean -xdf); - } elsif ($cleanmode eq 'none') { - } else { - die "$cleanmode ?"; - } my $pwd = cmdoutput qw(env - pwd); my $leafdir = basename $pwd; changedir "..";