diff options
Diffstat (limited to 'Debian/Debhelper/Dh_Getopt.pm')
-rw-r--r-- | Debian/Debhelper/Dh_Getopt.pm | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm index 864b168e..9868124c 100644 --- a/Debian/Debhelper/Dh_Getopt.pm +++ b/Debian/Debhelper/Dh_Getopt.pm @@ -121,10 +121,6 @@ sub getoptions { "A" => \$dh{PARAMS_ALL}, "all" => \$dh{PARAMS_ALL}, - "sourcedir=s" => \$dh{SOURCEDIR}, - - "destdir=s" => \$dh{DESTDIR}, - "priority=s" => \$dh{PRIORITY}, "h|help" => \&showhelp, @@ -143,6 +139,12 @@ sub getoptions { ) } +sub split_options_string { + my $str=shift; + $str=~s/^\s+//; + return split(/\s+/,$str); +} + # Parse options and set %dh values. sub parseopts { my $options=shift; @@ -152,10 +154,7 @@ sub parseopts { # DH_INTERNAL_OPTIONS is used to pass additional options from # dh through an override target to a command. if (defined $ENV{DH_INTERNAL_OPTIONS}) { - $ENV{DH_INTERNAL_OPTIONS}=~s/^\s+//; - $ENV{DH_INTERNAL_OPTIONS}=~s/\s+$//; - @ARGV_extra=split(/\s+/,$ENV{DH_INTERNAL_OPTIONS}); - + @ARGV_extra=split_options_string($ENV{DH_INTERNAL_OPTIONS}); # Unknown options will be silently ignored. my $oldwarn=$SIG{__WARN__}; $SIG{__WARN__}=sub {}; @@ -184,9 +183,7 @@ sub parseopts { # to be parsed like @ARGV, but with unknown options # skipped. if (defined $ENV{DH_OPTIONS}) { - $ENV{DH_OPTIONS}=~s/^\s+//; - $ENV{DH_OPTIONS}=~s/\s+$//; - @ARGV_extra=split(/\s+/,$ENV{DH_OPTIONS}); + @ARGV_extra=split_options_string($ENV{DH_OPTIONS}); my $ret=getoptions(\@ARGV_extra, $options); if (!$ret) { warning("warning: ignored unknown options in DH_OPTIONS"); |