summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Getopt.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-02-27 15:22:34 -0500
committerJoey Hess <joey@gnu.kitenet.net>2009-02-27 15:22:34 -0500
commit9c7cc9907c64f9975d49fc3504b0abbd747f18cc (patch)
tree7eb8e2bc3daf27b5692f144e8e1f7b1b82e986c8 /Debian/Debhelper/Dh_Getopt.pm
parent49f56882306c0cbb9b8d3d97d345589ba4c97edc (diff)
fix option parsing sideport
Diffstat (limited to 'Debian/Debhelper/Dh_Getopt.pm')
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm21
1 files changed, 10 insertions, 11 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index d8019337..3221a962 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -81,6 +81,14 @@ sub NonOption {
# Parse options and return a hash of the values.
sub parseopts {
undef %options;
+
+ # 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+$//;
+ unshift @ARGV, split(/\s+/,$ENV{DH_INTERNAL_OPTIONS});
+ }
my $ret=GetOptions(
"v" => \$options{VERBOSE},
@@ -190,20 +198,11 @@ sub parseopts {
"<>" => \&NonOption,
);
-
- # 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+$//;
- unshift @ARGV, split(/\s+/,$ENV{DH_INTERNAL_OPTIONS});
- }
-
- my $ret=getoptions(\@ARGV, $options);
+
if (!$ret) {
error("unknown option; aborting");
}
-
+
# Check to see if -V was specified. If so, but no parameters were
# passed, the variable will be defined but empty.
if (defined($options{V_FLAG})) {