summaryrefslogtreecommitdiff
path: root/dh
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-09-29 07:47:03 +0000
committerNiels Thykier <niels@thykier.net>2018-09-29 07:47:03 +0000
commit72ed1d3261730d56da6afde0ec7f52f32976e04d (patch)
tree8b1d5ee4a21e4da944a314c04e9a47be52eda89f /dh
parentb7348f222329db9ad9a8f669850c02572d2e9dad (diff)
downloaddebhelper-72ed1d3261730d56da6afde0ec7f52f32976e04d.tar.gz
dh: Disable cli-options NOOP PROMISE optimization with long options
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh')
-rwxr-xr-xdh7
1 files changed, 6 insertions, 1 deletions
diff --git a/dh b/dh
index 9b158ead..0fea4422 100755
--- a/dh
+++ b/dh
@@ -644,7 +644,7 @@ my %completed_sequences;
# Get the options to pass to commands in the sequence.
# Filter out options intended only for this program.
my (@options, %seen_options);
-my $unoptimizable_user_option = 0;
+my ($unoptimizable_user_option, $long_options_seen) = (0, 0);
if ($sequence eq 'build-arch' ||
$sequence eq 'install-arch' ||
@@ -687,6 +687,7 @@ while (@ARGV_orig) {
}
if ($opt =~ m/^(--[^=]++)(?:=.*)?$/ or $opt =~ m/^(-[^-])$/) {
my $optname = $1;
+ $long_options_seen = 1 if length($optname) > 2;
$seen_options{$optname} = 1;
} else {
$unoptimizable_user_option = 1;
@@ -1069,6 +1070,10 @@ sub can_skip {
return 0 if pkgfile($pkgs, $need) ne '';
} elsif ($type eq 'cli-options') {
$had_cli_options = 1;
+ # Long options are subject to abbreviations so it is
+ # very difficult to implement this optimization with
+ # long options.
+ return 0 if $long_options_seen;
$need =~ s/(?:^|\s)BUILDSYSTEM(?:\s|$)/${\UNSKIPPABLE_CLI_OPTIONS_BUILD_SYSTEM}/;
my @behavior_options = split(qr/\Q|\E/, $need);
for my $opt (@behavior_options) {