summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdgit17
1 files changed, 10 insertions, 7 deletions
diff --git a/dgit b/dgit
index f9a67ce..7d2023e 100755
--- a/dgit
+++ b/dgit
@@ -98,7 +98,11 @@ our %opts_opt_map = ('dget' => \@dget, # accept for compatibility
'mergechanges' => \@mergechanges);
our %opts_opt_cmdonly = ('gpg' => 1);
-our %opts_opt_cmdline_opts;
+our %opts_cfg_insertpos = map {
+ $_,
+ scalar @{ $opts_opt_map{$_} }
+} keys %opts_opt_map;
+
sub finalise_opts_opts();
our $keyid;
@@ -3056,7 +3060,7 @@ sub parseopts () {
!$opts_opt_cmdonly{$1} &&
($om = $opts_opt_map{$1})) {
push @ropts, $_;
- push @{ $opts_opt_cmdline_opts{$1} }, $2;
+ push @$om, $2;
} elsif (m/^--existing-package=(.*)/s) {
push @ropts, $_;
$existing_package = $1;
@@ -3181,7 +3185,10 @@ sub finalise_opts_opts () {
if ($?==0) {
badcfg "cannot configure options for $k"
if $opts_opt_cmdonly{$k};
- push @$om, split /\0/, $vs;
+ my $insertpos = $opts_cfg_insertpos{$k};
+ @$om = ( @$om[0..$insertpos-1],
+ (split /\0/, $vs),
+ @$om[$insertpos..$#$om] );
} elsif ($?==256) {
die "$k $c ?" if length $vs;
} else {
@@ -3189,10 +3196,6 @@ sub finalise_opts_opts () {
}
}
}
-
- foreach my $k (keys %opts_opt_cmdline_opts) {
- push @{ $opts_opt_map{$k} }, @{ $opts_opt_cmdline_opts{$k} };
- }
}
if ($ENV{$fakeeditorenv}) {