The following commit has been merged in the master branch:
commit b2a6feea95db7b4eea1892a2deb989d66d98f08d
Author: Guillem Jover <[email protected]>
Date: Thu Jan 3 02:34:47 2013 +0100
dpkg-genchanges: Do not use conditional declarations
These are quite confusing, instead just rearrange the code so that we
only declare it if we are going to need the variable.
Fixes Variables::ProhibitConditionalDeclarations.
Warned-by: perlcritic
diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl
index b97d5d0..7510bb5 100755
--- a/scripts/dpkg-genchanges.pl
+++ b/scripts/dpkg-genchanges.pl
@@ -473,10 +473,12 @@ $fields->{'Files'} = '';
my %filedone;
for my $f ($checksums->get_files(), @fileslistfiles) {
- my $arch_all = debarch_eq('all', $p2arch{$f2p{$f}}) if defined($f2p{$f});
+ if (defined $f2p{$f}) {
+ my $arch_all = debarch_eq('all', $p2arch{$f2p{$f}});
- next if (defined($arch_all) && ($include == ARCH_DEP and $arch_all));
- next if (defined($arch_all) && ($include == ARCH_INDEP and not $arch_all));
+ next if ($include == ARCH_DEP and $arch_all);
+ next if ($include == ARCH_INDEP and not $arch_all);
+ }
next if $filedone{$f}++;
my $uf = "$uploadfilesdir/$f";
$checksums->add_from_file($uf, key => $f);
diff --git a/test/100_critic.t b/test/100_critic.t
index 3c8beb8..898b911 100644
--- a/test/100_critic.t
+++ b/test/100_critic.t
@@ -88,6 +88,7 @@ my @policies = qw(
ValuesAndExpressions::RequireQuotedHeredocTerminator
ValuesAndExpressions::RequireUpperCaseHeredocTerminator
Variables::ProhibitAugmentedAssignmentInDeclaration
+ Variables::ProhibitConditionalDeclarations
Variables::ProhibitPerl4PackageNames
Variables::ProhibitUnusedVariables
Variables::ProtectPrivateVars
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]