summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-07 16:41:56 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-01-08 22:14:48 +0000
commit81a31ed44401d58cff028c12db896fa3badfd4ee (patch)
tree9dcb6157f183c83318c6c9b066528cda2f3994c1
parent1d34fdab75a2cab04ee30c10f6bcd32f02620b17 (diff)
dgit: Option parsing: Fix distro/suite reference bugs
By moving parseopts_late_defaults call. This is conceptually the same as finalise_late_opts, so do it there. We have to add a missing call to build_prep_early, as otherwise we call massage_dbp_args too soon. Also move a nopushing() call until after $isuite is set All of this means that we now honour $isuite (and sometimes $idistro) much better. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--debian/changelog4
-rwxr-xr-xdgit11
2 files changed, 11 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index ed1128e..b72ac69 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
dgit (2.17~) unstable; urgency=medium
+ Bugfixes:
+ * dgit config handling: Honour command-line and context-provided
+ suite and distro more reliably and consistently.
+
dgit-badcommit-fixup:
* Do not investigate symrefs. Closes:#850547.
diff --git a/dgit b/dgit
index 5207e0b..88bd431 100755
--- a/dgit
+++ b/dgit
@@ -143,6 +143,7 @@ our %opts_cfg_insertpos = map {
} keys %opts_opt_map;
sub finalise_opts_opts();
+sub parseopts_late_defaults();
our $keyid;
@@ -4076,7 +4077,6 @@ END
sub cmd_clone {
parseopts();
- notpushing();
my $dstdir;
badusage "-p is not allowed with clone; specify as argument instead"
if defined $package;
@@ -4091,8 +4091,9 @@ sub cmd_clone {
} else {
badusage "incorrect arguments to dgit clone";
}
- $dstdir ||= "$package";
+ notpushing();
+ $dstdir ||= "$package";
if (stat_exists $dstdir) {
fail "$dstdir already exists";
}
@@ -5637,6 +5638,7 @@ sub postbuild_mergechanges_vanilla ($) {
}
sub cmd_build {
+ build_prep_early();
my @dbp = (@dpkgbuildpackage, qw(-us -uc), changesopts_initial(), @ARGV);
my $wantsrc = massage_dbp_args \@dbp;
if ($wantsrc > 0) {
@@ -5790,6 +5792,7 @@ sub build_source {
}
sub cmd_build_source {
+ build_prep_early();
badusage "build-source takes no additional arguments" if @ARGV;
build_source();
maybe_unapply_patches_again();
@@ -6289,6 +6292,8 @@ sub finalise_opts_opts () {
@$om[$insertpos..$#$om] );
}
}
+
+ parseopts_late_defaults();
}
if ($ENV{$fakeeditorenv}) {
@@ -6349,8 +6354,6 @@ sub parseopts_late_defaults () {
}
}
-parseopts_late_defaults();
-
my $fn = ${*::}{"cmd_$cmd"};
$fn or badusage "unknown operation $cmd";
$fn->();