The following commit has been merged in the master branch:
commit 2d04ad209e93d5814c68801001dc5f333027577f
Author: Guillem Jover <[email protected]>
Date: Wed Jan 9 19:23:01 2013 +0100
dpkg-gencontrol: Move grep inside an if block
This makes the test explicit, and avoids confusing perlcritic of this
being a void grep.
Fixes BuiltinFunctions::ProhibitVoidGrep.
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index 5cc3b76..4116da4 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -209,10 +209,11 @@ foreach (keys %{$pkg}) {
scalar(@invalid_archs)),
join("' `", @invalid_archs))
if @invalid_archs >= 1;
- grep(debarch_is($host_arch, $_), @archlist) ||
+ if (! grep(debarch_is($host_arch, $_), @archlist)) {
error(_g("current host architecture '%s' does not " .
"appear in package's architecture list (%s)"),
$host_arch, "@archlist");
+ }
$fields->{$_} = $host_arch;
}
} else {
diff --git a/test/100_critic.t b/test/100_critic.t
index cfcc692..eaa8ff4 100644
--- a/test/100_critic.t
+++ b/test/100_critic.t
@@ -40,6 +40,7 @@ my @policies = qw(
BuiltinFunctions::ProhibitStringySplit
BuiltinFunctions::ProhibitUniversalCan
BuiltinFunctions::ProhibitUniversalIsa
+ BuiltinFunctions::ProhibitVoidGrep
BuiltinFunctions::RequireGlobFunction
BuiltinFunctions::RequireSimpleSortBlock
ClassHierarchies::ProhibitAutoloading
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]