[SCM] Git repository for devscripts branch, master, updated. v2.11.9-4-g8631936
James McCoy
jamessan at debian.org
Fri Jun 29 02:09:49 UTC 2012
The following commit has been merged in the master branch:
commit e1bef0e96bef8968899179bea898f94d5d166406
Author: James McCoy <jamessan at debian.org>
Date: Thu Jun 28 21:09:29 2012 -0400
Exit when unknown options are provided to GetOptions.
Closes: #679374
Signed-off-by: James McCoy <jamessan at debian.org>
diff --git a/debian/changelog b/debian/changelog
index 6c0b421..b32bef1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,16 @@
devscripts (2.11.10) UNRELEASED; urgency=low
+ [ Benjamin Drung ]
* debchange:
- Query name for stable-backport from distro-info.
- On Ubuntu always default to targeting the release that it's run from,
not the current devel release, since its primary use on stable releases
will be for preparing PPA uploads. (LP: #1001068)
+ [ James McCoy ]
+ * build-rdeps, chdist, debsnap, dpkg-depcheck, rc-alert: Exit when unknown
+ options are provided. (Closes: #679374)
+
-- Benjamin Drung <bdrung at debian.org> Sun, 17 Jun 2012 23:33:41 +0200
devscripts (2.11.9) unstable; urgency=low
diff --git a/scripts/build-rdeps.pl b/scripts/build-rdeps.pl
index c425509..bc7cc64 100755
--- a/scripts/build-rdeps.pl
+++ b/scripts/build-rdeps.pl
@@ -281,7 +281,7 @@ GetOptions(
"d|debug" => \$opt_debug,
"h|help" => sub { usage; },
"v|version" => sub { version; }
-);
+) or do { usage; exit 1; };
my $package = shift;
diff --git a/scripts/chdist.pl b/scripts/chdist.pl
index 0652edc..e7b8fa5 100755
--- a/scripts/chdist.pl
+++ b/scripts/chdist.pl
@@ -175,7 +175,7 @@ GetOptions(
"data-dir=s" => \$datadir,
"arch=s" => \$arch,
"version" => \$version,
-);
+) or usage(1);
# Fix-up relative paths
$datadir = cwd() . "/$datadir" if $datadir !~ m!^/!;
diff --git a/scripts/debsnap.pl b/scripts/debsnap.pl
index e609551..5b6cb35 100755
--- a/scripts/debsnap.pl
+++ b/scripts/debsnap.pl
@@ -202,7 +202,7 @@ sub verbose($)
read_conf(@ARGV);
Getopt::Long::Configure('gnu_compat');
Getopt::Long::Configure('no_ignore_case');
-GetOptions(\%opt, 'verbose|v', 'destdir|d=s', 'force|f', 'help|h', 'version', 'binary', 'architecture|a=s@') || exit 1;
+GetOptions(\%opt, 'verbose|v', 'destdir|d=s', 'force|f', 'help|h', 'version', 'binary', 'architecture|a=s@') || usage(1);
usage(0) if $opt{help};
usage(1) unless @ARGV;
diff --git a/scripts/dpkg-depcheck.pl b/scripts/dpkg-depcheck.pl
index e9205ed..cbb0a25 100755
--- a/scripts/dpkg-depcheck.pl
+++ b/scripts/dpkg-depcheck.pl
@@ -180,33 +180,28 @@ $opts{"pkgs"} = 'all';
$opts{"allpkgs"} = 0;
Getopt::Long::Configure('bundling','require_order');
-my $opts_ret =
- GetOptions("h|help" => sub { usage(); exit; },
- "v|version" => sub { version(); exit; },
- "a|all" => sub { $opts{"allpkgs"}=1; },
- "b|build-depends" => sub { $opts{"pkgs"}='build'; },
- "d|ignore-dev-deps" => sub { $opts{"pkgs"}='dev'; },
- "m|min-deps" => sub { $opts{"pkgs"}='min'; },
- "C|C-locale" => \$opts{"C"},
- "no-C-locale|noC-locale" => sub { $opts{"C"}=0; },
- "l|list-files" => \$opts{"l"},
- "no-list-files|nolist-files" => sub { $opts{"l"}=0; },
- "o|output=s" => \$opts{"o"},
- "O|strace-output=s" => \$opts{"strace-output"},
- "I|strace-input=s" => \$opts{"strace-input"},
- "f|features=s" => \&process_features,
- "no-conf" => \$opts{"noconf"},
- "noconf" => \$opts{"noconf"},
- );
+GetOptions("h|help" => sub { usage(); exit; },
+ "v|version" => sub { version(); exit; },
+ "a|all" => sub { $opts{"allpkgs"}=1; },
+ "b|build-depends" => sub { $opts{"pkgs"}='build'; },
+ "d|ignore-dev-deps" => sub { $opts{"pkgs"}='dev'; },
+ "m|min-deps" => sub { $opts{"pkgs"}='min'; },
+ "C|C-locale" => \$opts{"C"},
+ "no-C-locale|noC-locale" => sub { $opts{"C"}=0; },
+ "l|list-files" => \$opts{"l"},
+ "no-list-files|nolist-files" => sub { $opts{"l"}=0; },
+ "o|output=s" => \$opts{"o"},
+ "O|strace-output=s" => \$opts{"strace-output"},
+ "I|strace-input=s" => \$opts{"strace-input"},
+ "f|features=s" => \&process_features,
+ "no-conf" => \$opts{"noconf"},
+ "noconf" => \$opts{"noconf"},
+ ) or do { usage; exit 1; };
if ($opts{"noconf"}) {
die "$progname: --no-conf is only acceptable as the first command-line option!\n";
}
-if (! $opts_ret) {
- die "$progname: I didn't recognise some command-line option there;\nplease fix and try again. (Use --help for more info.)\n";
-}
-
if ($opts{"pkgs"} eq 'all') {
$opts{"allpkgs"} = 0;
} else {
diff --git a/scripts/rc-alert.pl b/scripts/rc-alert.pl
index 610cc65..a98e5d0 100755
--- a/scripts/rc-alert.pl
+++ b/scripts/rc-alert.pl
@@ -138,7 +138,7 @@ GetOptions("help|h" => \$opt_help,
"popcon" => \$popcon,
"pc-vote" => \$popcon_by_vote,
"pc-local" => \$popcon_local,
- );
+ ) or do { print $usage; exit 1; };
if ($opt_help) { print $usage; exit 0; }
if ($opt_version) { print $version; exit 0; }
--
Git repository for devscripts
More information about the devscripts-devel
mailing list