The following commit has been merged in the master branch:
commit 9feb1c833b0264e3c062698c591d3d1dd528764d
Author: Guillem Jover <[email protected]>
Date: Mon Dec 31 22:13:39 2012 +0100
scripts: Initialize arrays with the qw() operator
Fixes CodeLayout::ProhibitQuotedWordLists.
Warned-by: perlcritic
diff --git a/scripts/Dpkg/Vendor/Ubuntu.pm b/scripts/Dpkg/Vendor/Ubuntu.pm
index 039fd5a..5b28c4f 100644
--- a/scripts/Dpkg/Vendor/Ubuntu.pm
+++ b/scripts/Dpkg/Vendor/Ubuntu.pm
@@ -126,8 +126,7 @@ sub run_hook {
my @options = split(/,\s*/, $hardening);
$hardening = 1;
- my @hardopts = ('format', 'fortify', 'stackprotector',
- 'pie', 'relro');
+ my @hardopts = qw(format fortify stackprotector pie relro);
foreach my $item (@hardopts) {
my $upitem = uc($item);
foreach my $option (@options) {
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 2c76aaf..e557c93 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -213,21 +213,21 @@ while (@ARGV) {
build_sourceonly && usageerr(_g('cannot combine %s and %s'), $_, '-S');
$include = BUILD_ARCH_DEP;
push @changes_opts, '-B';
- @checkbuilddep_opts = ('-B');
+ @checkbuilddep_opts = qw(-B);
$buildtarget = 'build-arch';
$binarytarget = 'binary-arch';
} elsif (/^-A$/) {
build_sourceonly && usageerr(_g('cannot combine %s and %s'), $_, '-S');
$include = BUILD_ARCH_INDEP;
push @changes_opts, '-A';
- @checkbuilddep_opts = ('-A');
+ @checkbuilddep_opts = qw(-A);
$buildtarget = 'build-indep';
$binarytarget = 'binary-indep';
} elsif (/^-S$/) {
build_binaryonly && usageerr(_g('cannot combine %s and %s'), build_opt,
'-S');
$include = BUILD_SOURCE;
push @changes_opts, '-S';
- @checkbuilddep_opts = ('-A', '-B');
+ @checkbuilddep_opts = qw(-A -B);
} elsif (/^-F$/) {
!build_normal && usageerr(_g('cannot combine %s and %s'), $_,
build_opt);
$include = BUILD_ALL;
diff --git a/scripts/dpkg-name.pl b/scripts/dpkg-name.pl
index ed61730..9e9caf7 100755
--- a/scripts/dpkg-name.pl
+++ b/scripts/dpkg-name.pl
@@ -198,9 +198,9 @@ sub move($)
my @command;
if ($options{symlink}) {
- @command = ('ln', '-s', '--');
+ @command = qw(ln -s --);
} else {
- @command = ('mv', '--');
+ @command = qw(mv --);
}
if (filesame($newname, $filename)) {
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index ac08e6a..6be9164 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -303,9 +303,9 @@ if ($options{opmode} =~
/^(-b|--print-format|--(before|after)-build|--commit)$/)
# If we encounter one 'any' then the other arches become insignificant
# except for 'all' that must also be kept
if (grep($_ eq 'all', @sourcearch)) {
- @sourcearch = ('any', 'all');
+ @sourcearch = qw(any all);
} else {
- @sourcearch = ('any');
+ @sourcearch = qw(any);
}
} else {
# Minimize arch list, by removing arches already covered by wildcards
diff --git a/test/100_critic.t b/test/100_critic.t
index 9b3e9e1..7e7fb5d 100644
--- a/test/100_critic.t
+++ b/test/100_critic.t
@@ -44,6 +44,7 @@ my @policies = qw(
ClassHierarchies::ProhibitAutoloading
ClassHierarchies::ProhibitExplicitISA
ClassHierarchies::ProhibitOneArgBless
+ CodeLayout::ProhibitQuotedWordLists
CodeLayout::RequireConsistentNewlines
ControlStructures::ProhibitLabelsWithSpecialBlockNames
ControlStructures::ProhibitUntilBlocks
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]