]> git.donarmstrong.com Git - debhelper.git/commitdiff
drop regex support from remove_command_options
authorJoey Hess <joey@gnu.kitenet.net>
Wed, 26 Aug 2009 20:41:53 +0000 (16:41 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Wed, 26 Aug 2009 20:41:53 +0000 (16:41 -0400)
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.

dh
doc/PROGRAMMING

diff --git a/dh b/dh
index f03bf006d8179b614f60496364a671b6f20c6d99..710117ead15d9db779a913b4068118e3322a2367 100755 (executable)
--- 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;
                }
index 211e57eef9570472a0c32fe8705f4d8a19a5c51f..5f236ebdc4983f090803165ae8c38cc0ee6e4e0b 100644 (file)
@@ -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:
 -------------------