summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-01-19 00:50:35 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-01-19 00:50:35 +0000
commit5dbf5d3d2ef07b059c732abe77d1657e3fc3f714 (patch)
tree66ef226e70e1b5f85f68b10e519dcd759b8eb74c
parent95cce6041df774f7909b28c110417881f1d4792a (diff)
Run a clean (of the specified type) before any build operation; do this with `dpkg-buildpackage -T' clean if necessary, so -wd now works with all the building methods.
-rw-r--r--debian/changelog3
-rwxr-xr-xdgit22
-rw-r--r--dgit.12
3 files changed, 16 insertions, 11 deletions
diff --git a/debian/changelog b/debian/changelog
index 18ab786..bfdb0e9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,9 @@ dgit (0.21~~iwj) unstable; urgency=low
with earlier versions of dpkg.
* Provide --build-products-dir option (and corresponding semantics
for -C) to specify where to find the files to upload. Closes:#731633.
+ * Run a clean (of the specified type) before any build operation; do
+ this with `dpkg-buildpackage -T' clean if necessary, so -wd now works
+ with all the building methods.
--
diff --git a/dgit b/dgit
index 5b99ed1..7752d82 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 "..";
diff --git a/dgit.1 b/dgit.1
index b23a3a8..67e4751 100644
--- a/dgit.1
+++ b/dgit.1
@@ -217,7 +217,7 @@ Do not clean the tree before building a source package. If there are
files which are not in git, a subsequent dgit push will fail.
.TP
.BR --clean=dpkg-source | -wd
-Use dpkg-buildpackage to do the build, so that the source package
+Use dpkg-buildpackage to do the clean, so that the source package
is cleaned by dpkg-source running the package's clean target.
This is the default. It requires the package's build dependencies.
.TP