summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index 4df3eed2..f27775b4 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -70,6 +70,7 @@ sub getoptions {
my $array=shift;
my %params=@_;
+ my @test;
my %options=(
"v" => \$dh{VERBOSE},
"verbose" => \$dh{VERBOSE},
@@ -130,14 +131,8 @@ sub getoptions {
"ignore=s" => \&AddIgnore,
- "O=s" => sub { my($option,$value)=@_;
- # Try to parse an option, but ignore it
- # if it is not known.
- if (getoptions([$value], %params, test => 1)) {
- getoptions([$value], %params);
- }
- },
-
+ "O=s" => sub { push @test, $_[1] },
+
(ref $params{options} ? %{$params{options}} : ()) ,
"<>" => \&NonOption,
@@ -159,6 +154,14 @@ sub getoptions {
$SIG{__WARN__}=$oldwarn;
}
+ foreach my $opt (@test) {
+ # Try to parse an option, but ignore it
+ # if it is not known.
+ if (getoptions([$opt], %params, test => 1)) {
+ getoptions([$opt], %params);
+ }
+ }
+
return 1 if $params{ignore_unknown_options};
return $ret;
}