summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-30 21:25:38 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-04 19:24:46 +0100
commit54bd461a80ec31613c02831bd7c889ea9f91ed65 (patch)
tree0609a88d334637088f9b463346d886d42b0090a9 /dgit
parentf2b31f244345116f1f64d0b56afa76eedaff69c4 (diff)
--clean=git and --clean=none cause dgit to pass -nc to dpkg-buildpackage, suppressing calls to the package's clean target. Also, expand the documentation in this area slightly. Closes:#768590.
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit22
1 files changed, 20 insertions, 2 deletions
diff --git a/dgit b/dgit
index 19c0657..f0f1651 100755
--- a/dgit
+++ b/dgit
@@ -2628,17 +2628,35 @@ sub changesopts () {
return @opts;
}
+sub massage_dbp_args ($) {
+ my ($cmd) = @_;
+ return unless $cleanmode =~ m/git|none/;
+ debugcmd '#massaging#', @$cmd if $debuglevel>1;
+ my @newcmd = shift @$cmd;
+ # -nc has the side effect of specifying -b if nothing else specified
+ push @newcmd, '-nc';
+ # and some combinations of -S, -b, et al, are errors, rather than
+ # later simply overriding earlier
+ push @newcmd, '-F' unless grep { m/^-[bBASF]$/ } @$cmd;
+ push @newcmd, @$cmd;
+ @$cmd = @newcmd;
+}
+
sub cmd_build {
build_prep();
- runcmd_ordryrun_local @dpkgbuildpackage, qw(-us -uc), changesopts(), @ARGV;
+ my @dbp = (@dpkgbuildpackage, qw(-us -uc), changesopts(), @ARGV);
+ massage_dbp_args \@dbp;
+ runcmd_ordryrun_local @dbp;
printdone "build successful\n";
}
sub cmd_git_build {
build_prep();
+ my @dbp = @dpkgbuildpackage;
+ massage_dbp_args \@dbp;
my @cmd =
(qw(git-buildpackage -us -uc --git-no-sign-tags),
- "--git-builder=@dpkgbuildpackage");
+ "--git-builder=@dbp");
unless (grep { m/^--git-debian-branch|^--git-ignore-branch/ } @ARGV) {
canonicalise_suite();
push @cmd, "--git-debian-branch=".lbranch();