diff options
author | Niels Thykier <niels@thykier.net> | 2018-09-29 07:47:03 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2018-09-29 07:47:03 +0000 |
commit | 72ed1d3261730d56da6afde0ec7f52f32976e04d (patch) | |
tree | 8b1d5ee4a21e4da944a314c04e9a47be52eda89f /dh | |
parent | b7348f222329db9ad9a8f669850c02572d2e9dad (diff) | |
download | debhelper-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-x | dh | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) { |