From: Joey Hess Date: Wed, 26 Aug 2009 20:41:53 +0000 (-0400) Subject: drop regex support from remove_command_options X-Git-Tag: 7.3.16~5 X-Git-Url: https://git.donarmstrong.com/?p=debhelper.git;a=commitdiff_plain;h=d64e9b242a1c3c9b35f006eec048a3cf683fc925 drop regex support from remove_command_options I hope that it will not be needed; indeed I doubt that remove_command_options will be used much, because sequence addons would need to try to do conflicting things to need it. And the interface makes it hard for such conflicting sequence addons to work around the other, since addons can be loaded in either order. So let's not encourage them too much, and if there's a use case later, we can made changes. I haven't applied Modestas's enhanced patch that allows adding an option to all commands because I similarly think it might not be used. If a use case comes along we can add something like that. --- diff --git a/dh b/dh index f03bf00..710117e 100755 --- a/dh +++ b/dh @@ -346,12 +346,7 @@ sub remove_command_options { # Remove only specified options if (my $opts = $command_opts{$command}) { foreach my $opt (@_) { - if (ref($opt) eq "Regexp") { - $opts = [ grep ! /$opt/, @$opts ]; - } - else { - $opts = [ grep { $_ ne $opt } @$opts ]; - } + $opts = [ grep { $_ ne $opt } @$opts ]; } $command_opts{$command} = $opts; } diff --git a/doc/PROGRAMMING b/doc/PROGRAMMING index 211e57e..5f236eb 100644 --- a/doc/PROGRAMMING +++ b/doc/PROGRAMMING @@ -281,8 +281,7 @@ remove_command_options($command) remove_command_options($command, $opt1, $opt2, ...) Remove $opt1, $opt2 etc. from the list of additional options which - dh passes when running the specified $command. $optX might be a string - or a regular expresion. + dh passes when running the specified $command. Buildsystem Classes: -------------------