The following commit has been merged in the master branch:
commit 1dbc70121f3783de4ad294cd6130b4cc794fe9e2
Author: Guillem Jover <[email protected]>
Date: Sun Jun 23 17:04:36 2013 +0200
scripts: Move Getopt::Long option specifications to array variables
diff --git a/scripts/changelog/debian.pl b/scripts/changelog/debian.pl
index 7e7c10f..35c8412 100755
--- a/scripts/changelog/debian.pl
+++ b/scripts/changelog/debian.pl
@@ -89,7 +89,7 @@ sub set_format {
$format = $val;
}
-GetOptions(
+my @options_spec = (
'file=s' => \$file,
'label|l=s' => \$label,
'since|v=s' => \$since,
@@ -102,7 +102,9 @@ GetOptions(
'version|V' => sub{version();exit(0)},
'format=s' => \&set_format,
'all|a' => \$all,
-)
+);
+
+GetOptions(@options_spec)
or do { usage(); exit(2) };
usageerr('too many arguments') if @ARGV > 1;
diff --git a/scripts/dpkg-checkbuilddeps.pl b/scripts/dpkg-checkbuilddeps.pl
index 242f666..758ecdb 100755
--- a/scripts/dpkg-checkbuilddeps.pl
+++ b/scripts/dpkg-checkbuilddeps.pl
@@ -65,14 +65,18 @@ my $ignore_bd_indep = 0;
my ($bd_value, $bc_value);
my $host_arch = get_host_arch();
my $admindir = $Dpkg::ADMINDIR;
-if (!GetOptions('A' => \$ignore_bd_arch,
- 'B' => \$ignore_bd_indep,
- 'help|?' => sub { usage(); exit(0); },
- 'version' => \&version,
- 'd=s' => \$bd_value,
- 'c=s' => \$bc_value,
- 'a=s' => \$host_arch,
- 'admindir=s' => \$admindir)) {
+my @options_spec = (
+ 'help|?' => sub { usage(); exit(0); },
+ 'version' => \&version,
+ 'A' => \$ignore_bd_arch,
+ 'B' => \$ignore_bd_indep,
+ 'd=s' => \$bd_value,
+ 'c=s' => \$bc_value,
+ 'a=s' => \$host_arch,
+ 'admindir=s' => \$admindir,
+);
+
+if (!GetOptions(@options_spec)) {
usage();
exit(2);
}
diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl
index 0dc4f62..87593e4 100755
--- a/scripts/dpkg-mergechangelogs.pl
+++ b/scripts/dpkg-mergechangelogs.pl
@@ -72,9 +72,14 @@ Options:
}
my $merge_prereleases;
-unless (GetOptions('help|?' => sub { usage(); exit(0) },
- 'merge-prereleases|m' => \$merge_prereleases,
- 'version' => sub { version(); exit(0) })) {
+
+my @options_spec = (
+ 'help|?' => sub { usage(); exit(0) },
+ 'version' => sub { version(); exit(0) },
+ 'merge-prereleases|m' => \$merge_prereleases,
+);
+
+unless (GetOptions(@options_spec)) {
usage();
exit(2);
}
diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index d2d528d..6b01d48 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -52,10 +52,17 @@ my %options = (help => sub { usage(); exit 0; },
medium => undef,
);
-my $result = GetOptions(\%options,
- 'help|?', 'version', 'type|t=s',
- 'arch|a=s', 'multiversion|m!', 'extra-override|e=s',
- 'medium|M=s');
+my @options_spec = (
+ 'help|?',
+ 'version',
+ 'type|t=s',
+ 'arch|a=s',
+ 'multiversion|m!',
+ 'extra-override|e=s',
+ 'medium|M=s',
+);
+
+my $result = GetOptions(\%options, @options_spec);
sub version {
printf _g("Debian %s version %s.\n"), $Dpkg::PROGNAME, $Dpkg::PROGVERSION;
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]