[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.11-208-g0421f85



The following commit has been merged in the master branch:
commit 0421f85039efb80b13838fb02185ec14c8133191
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Apr 1 15:20:11 2013 +0200

    Avoid using "grep" in boolean and some scalar contexts
    
    Replace boolean/trival scalar context uses of grep with "any" (etc.)
    from List::MoreUtils.  This adds a (Build-)Depends on
    liblist-moreutils-perl.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/.perlcriticrc b/.perlcriticrc
index 1003273..649d14b 100644
--- a/.perlcriticrc
+++ b/.perlcriticrc
@@ -24,6 +24,8 @@ criticism-fatal = 1
 color = 1
 allow-unsafe = 1
 
+[BuiltinFunctions::ProhibitBooleanGrep]
+
 [ValuesAndExpressions::ProhibitInterpolationOfLiterals]
 allow_if_string_contains_single_quote = 1
 
diff --git a/checks/changelog-file b/checks/changelog-file
index 68cf61b..9084ca7 100644
--- a/checks/changelog-file
+++ b/checks/changelog-file
@@ -22,14 +22,16 @@ package Lintian::changelog_file;
 use strict;
 use warnings;
 
+use Encode qw(decode);
+use List::Util qw(first);
+use List::MoreUtils qw(any);
+use Parse::DebianChangelog;
+
+use Lintian::Check qw(check_spelling);
 use Lintian::Relation::Version qw(versions_gt);
 use Lintian::Tags qw(tag);
-use Lintian::Check qw(check_spelling);
 use Lintian::Util qw(fail file_is_encoded_in_non_utf8);
 
-use Encode qw(decode);
-use Parse::DebianChangelog;
-
 sub run {
 
 my ($pkg, $type, $info, undef, $group) = @_;
@@ -165,12 +167,11 @@ $foreign_pkg = (!$native_pkg && $version !~ m/-0\./);
 # case, both vars are false
 
 if ($native_pkg) {
-    my @foo;
     # native Debian package
-    if (grep m/^changelog(?:\.gz)?$/,@doc_files) {
+    if (any { m/^changelog(?:\.gz)?$/} @doc_files) {
         # everything is fine
-    } elsif (@foo = grep m/^changelog\.debian(?:\.gz)$/i,@doc_files) {
-        tag 'wrong-name-for-changelog-of-native-package', "usr/share/doc/$pkg/$foo[0]";
+    } elsif (my $chg = first { m/^changelog\.debian(?:\.gz)$/i} @doc_files) {
+        tag 'wrong-name-for-changelog-of-native-package', "usr/share/doc/$pkg/$chg";
     } else {
         tag 'changelog-file-missing-in-native-package';
     }
@@ -179,7 +180,7 @@ if ($native_pkg) {
 
     # 1. check for upstream changelog
     my $found_upstream_text_changelog = 0;
-    if (grep m/^changelog(\.html)?(?:\.gz)?$/,@doc_files) {
+    if (any { m/^changelog(\.html)?(?:\.gz)?$/ } @doc_files) {
         $found_upstream_text_changelog = 1 unless $1;
         # everything is fine
     } else {
@@ -198,10 +199,10 @@ if ($native_pkg) {
     }
 
     # 2. check for Debian changelog
-    if (grep m/^changelog\.Debian(?:\.gz)?$/,@doc_files) {
+    if (any { m/^changelog\.Debian(?:\.gz)?$/ } @doc_files) {
         # everything is fine
-    } elsif (my @foo = grep m/^changelog\.debian(?:\.gz)?$/i,@doc_files) {
-        tag 'wrong-name-for-debian-changelog-file', "usr/share/doc/$pkg/$foo[0]";
+    } elsif (my $chg = first { m/^changelog\.debian(?:\.gz)?$/i } @doc_files) {
+        tag 'wrong-name-for-debian-changelog-file', "usr/share/doc/$pkg/$chg";
     } else {
         if ($foreign_pkg && $found_upstream_text_changelog) {
             tag 'debian-changelog-file-missing-or-wrong-name';
diff --git a/checks/control-file b/checks/control-file
index a39c789..346174d 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -22,6 +22,7 @@ package Lintian::control_file;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
 use List::Util qw(first);
 
 use Lintian::Data ();
@@ -283,7 +284,7 @@ sub check_dev_depends {
         # If there are any alternatives here, something special is
         # going on.  Assume that the maintainer knows what they're
         # doing.  Otherwise, separate out just the versions.
-        next if grep { /\|/ } @depends;
+        next if any { /\|/ } @depends;
         my @versions = sort map {
             if (/^[\w.+-]+(?:\s*\(([^\)]+)\))/) {
                 $1;
diff --git a/checks/copyright-file b/checks/copyright-file
index 6ae188e..eb474ea 100644
--- a/checks/copyright-file
+++ b/checks/copyright-file
@@ -22,13 +22,14 @@ package Lintian::copyright_file;
 use strict;
 use warnings;
 
+use Encode qw(decode);
+use List::MoreUtils qw(any);
+
 use Lintian::Check qw(check_spelling);
 use Lintian::Data ();
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(fail slurp_entire_file file_is_encoded_in_non_utf8);
 
-use Encode qw(decode);
-
 our $KNOWN_ESSENTIAL = Lintian::Data->new('fields/essential');
 
 sub run {
@@ -288,7 +289,7 @@ if ($gpl || m,/usr/share/common-licenses/GPL,) {
         if (defined $info->field('pre-depends')) {
             push @depends, split (/\s*,\s*/, scalar $info->field('pre-depends'));
         }
-        if (grep { /^libssl[0-9.]+(?:\s|\z)/ && !/\|/ } @depends) {
+        if (any { /^libssl[0-9.]+(?:\s|\z)/ && !/\|/ } @depends) {
             tag 'possible-gpl-code-linked-with-openssl';
         }
     }
diff --git a/checks/debian-source-dir b/checks/debian-source-dir
index 35d96da..161e77d 100644
--- a/checks/debian-source-dir
+++ b/checks/debian-source-dir
@@ -22,6 +22,8 @@ package Lintian::debian_source_dir;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
+
 use Lintian::Data;
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(fail);
@@ -50,7 +52,7 @@ if ( ! -l "$dsrc/format" && -e "$dsrc/format") {
 if ( ! -l "$dsrc/git-patches" && -s "$dsrc/git-patches") {
     open GITPATCHES, '<', "$dsrc/git-patches"
         or fail("cannot open debian/source/git-patches: $!");
-    if (grep !/^\s*+#|^\s*+$/o, <GITPATCHES>) {
+    if (any { !/^\s*+#|^\s*+$/o} <GITPATCHES>) {
         my $dpseries = $info->debfiles('patches/series');
         # gitpkg does not create series as a link, so this is most likely
         # a traversal attempt.
diff --git a/checks/duplicate-files b/checks/duplicate-files
index ae56059..a38dd20 100644
--- a/checks/duplicate-files
+++ b/checks/duplicate-files
@@ -22,6 +22,8 @@ package Lintian::duplicate_files;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
+
 use Lintian::Tags qw(tag);
 
 sub run {
@@ -52,7 +54,7 @@ foreach my $file ($info->sorted_index){
 foreach my $hash (keys %hashmap){
     my @files = @{ $hashmap{$hash} };
     next if scalar(@files) < 2;
-    if (grep { m,changelog,io} @files) {
+    if (any { m,changelog,io} @files) {
         tag 'duplicate-changelog-files', sort @files;
     } else {
         tag 'duplicate-files', sort @files;
diff --git a/checks/fields b/checks/fields
index 3536bf5..5f74a6f 100644
--- a/checks/fields
+++ b/checks/fields
@@ -27,6 +27,7 @@ use strict;
 use warnings;
 
 use Dpkg::Version qw(version_check);
+use List::MoreUtils qw(any true);
 
 use Lintian::Architecture qw(:all);
 use Lintian::Data ();
@@ -394,7 +395,7 @@ for my $f (qw(maintainer uploaders)) {
                 split />\K\s*,\s*/, $maintainer;
             for my $uploader (@uploaders) {
                 check_maintainer($uploader, 'uploader');
-                if ( ((grep { $_ eq $uploader } @uploaders) > 1) and
+                if ( ((true { $_ eq $uploader } @uploaders) > 1) and
                      ($duplicate_uploaders{$uploader}++ == 0)) {
                     tag 'duplicate-uploader', $uploader;
                 }
@@ -610,7 +611,7 @@ if (($type eq 'binary') || ($type eq 'udeb')) {
 
         my (@seen_libstdcs, @seen_tcls, @seen_tclxs, @seen_tks, @seen_tkxs, @seen_libpngs);
 
-        my $is_dep_field = sub { grep { $_ eq $_[0] } qw(depends pre-depends recommends suggests) };
+        my $is_dep_field = sub { any { $_ eq $_[0] } qw(depends pre-depends recommends suggests) };
 
         tag 'alternates-not-allowed', $field
             if ($data =~ /\|/ && ! &$is_dep_field($field));
@@ -665,7 +666,7 @@ if (($type eq 'binary') || ($type eq 'udeb')) {
                     if ($field eq 'conflicts' && $d_version->[0]);
 
                 tag 'obsolete-relation-form', "$field: $part_d_orig"
-                    if ($d_version && grep { $d_version->[0] eq $_ } ('<', '>'));
+                    if ($d_version && any { $d_version->[0] eq $_ } ('<', '>'));
 
                 tag 'bad-version-in-relation', "$field: $part_d_orig"
                     if ($d_version->[0] && ! version_check($d_version->[1]));
@@ -809,7 +810,7 @@ if ($type eq 'source') {
     tag 'build-depends-indep-without-arch-indep'
         if (defined $info->field('build-depends-indep') && $arch_indep_packages == 0);
 
-    my $is_dep_field = sub { grep { $_ eq $_[0] } qw(build-depends build-depends-indep) };
+    my $is_dep_field = sub { any { $_ eq $_[0] } qw(build-depends build-depends-indep) };
 
     my %depend;
     for my $field (qw(build-depends build-depends-indep build-conflicts build-conflicts-indep)) {
@@ -972,7 +973,7 @@ if (defined $info->field('python-version')) {
 
     my @pyversion = split(/\s*,\s*/, $pyversion);
     if (@pyversion > 2) {
-        if (grep { !/^\d+\.\d+$/ } @pyversion) {
+        if (any { !/^\d+\.\d+$/ } @pyversion) {
             tag 'malformed-python-version', $pyversion;
         }
     } else {
@@ -1020,7 +1021,7 @@ while (my ($vcs, $splitter) = each %VCS_EXTRACT) {
                     tag 'vcs-field-uses-unknown-uri-format', "vcs-$vcs", $uri;
                 }
             }
-            if (grep { $_ and /\s/} @parts) {
+            if (any { $_ and /\s/} @parts) {
                 tag 'vcs-field-has-unexpected-spaces', "vcs-$vcs", $uri;
             }
         }
diff --git a/checks/init.d b/checks/init.d
index 00433b4..a14a715 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -22,6 +22,8 @@ package Lintian::init_d;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any none);
+
 use Lintian::Data;
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(fail);
@@ -184,7 +186,7 @@ opendir INITD, $initd_dir
     or fail "cannot read init.d directory: $!";
 for my $script (readdir(INITD)) {
     my $tagname = 'script-in-etc-init.d-not-registered-via-update-rc.d';
-    next if grep {$script eq $_} qw(. .. README skeleton rc rcS);
+    next if any {$script eq $_} qw(. .. README skeleton rc rcS);
 
     my $script_path = "$initd_dir/$script";
 
@@ -352,7 +354,7 @@ sub check_init {
         if (length($stop) > 0 and $stop ne '0 1 6') {
             my $base = $initd_file;
             $base =~ s,.*/,,;
-            unless (grep { $base eq $_ } qw(killprocs sendsigs halt reboot)) {
+            if (none { $base eq $_ } qw(killprocs sendsigs halt reboot)) {
                 my @missing = grep { !defined $stop{$_} } qw(0 1 6);
                 tag 'init.d-script-possible-missing-stop', "etc/init.d/${initd_file}",
                     @missing;
@@ -384,13 +386,13 @@ sub check_init {
     if (defined $lsb{'default-start'} && length($lsb{'default-start'})) {
         my @required = split(' ', $lsb{'required-start'} || '');
         if ($needs_fs{remote}) {
-            unless (grep { /^\$(?:remote_fs|all)\z/ } @required) {
+            if (none { /^\$(?:remote_fs|all)\z/ } @required) {
                 tag 'init.d-script-missing-dependency-on-remote_fs',
                     "etc/init.d/${initd_file}: required-start";
             }
         }
         if ($needs_fs{local}) {
-            unless (grep { /^\$(?:local_fs|remote_fs|all)\z/ } @required) {
+            if (none { /^\$(?:local_fs|remote_fs|all)\z/ } @required) {
                 tag 'init.d-script-missing-dependency-on-local_fs',
                     "etc/init.d/${initd_file}: required-start";
             }
@@ -399,13 +401,13 @@ sub check_init {
     if (defined $lsb{'default-stop'} && length($lsb{'default-stop'})) {
         my @required = split(' ', $lsb{'required-stop'} || '');
         if ($needs_fs{remote}) {
-            unless (grep { /^(?:\$remote_fs|\$all|umountnfs)\z/ } @required) {
+            if (none { /^(?:\$remote_fs|\$all|umountnfs)\z/ } @required) {
                 tag 'init.d-script-missing-dependency-on-remote_fs',
                     "etc/init.d/${initd_file}: required-stop";
             }
         }
         if ($needs_fs{local}) {
-            unless (grep { /^(?:\$(?:local|remote)_fs|\$all|umountn?fs)\z/ } @required) {
+            if (none { /^(?:\$(?:local|remote)_fs|\$all|umountn?fs)\z/ } @required) {
                 tag 'init.d-script-missing-dependency-on-local_fs',
                     "etc/init.d/${initd_file}: required-stop";
             }
diff --git a/checks/java b/checks/java
index c2dd394..b4a73cf 100644
--- a/checks/java
+++ b/checks/java
@@ -22,6 +22,8 @@ package Lintian::java;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any none);
+
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(resolve_pkg_path);
 
@@ -102,7 +104,7 @@ for my $jar_file (sort keys %{$java_info}) {
     }
 
     $datafiles = 0
-        unless grep m/\.(?:xml|properties|x?html|xhp)$/io, keys %$files;
+        if none { m/\.(?:xml|properties|x?html|xhp)$/io } keys %$files;
 
     if($operm & 0111) {
         # Executable ?
@@ -141,7 +143,7 @@ for my $jar_file (sort keys %{$java_info}) {
         $need_cp = 0 if $bsname;
         # Maybe it is a maven plugin?
         $need_cp = 0 if $need_cp
-            && grep { m,^META-INF/maven/plugin.xml$,io } keys %$files;
+            && any { m,^META-INF/maven/plugin.xml$,io } keys %$files;
     } else {
         # Only run the tests when a classpath is present
         my @relative = ();
@@ -212,7 +214,7 @@ if($has_jars && $need_cp) {
 
 if(! $has_public_jars && $pkg =~ /^lib[^\s,]+-java$/) {
     # Skip this if it installs a symlink in usr/share/java
-    return if grep m@^usr/share/java/[^/]+\.jar$@o, $info->sorted_index;
+    return if any { m@^usr/share/java/[^/]+\.jar$@o } $info->sorted_index;
     tag 'javalib-but-no-public-jars';
 }
 
diff --git a/checks/manpages b/checks/manpages
index ee08301..d755006 100644
--- a/checks/manpages
+++ b/checks/manpages
@@ -22,13 +22,14 @@ package Lintian::manpages;
 use strict;
 use warnings;
 
+use File::Basename;
+use List::MoreUtils qw(any none);
+use Text::ParseWords ();
+
 use Lintian::Check qw(check_spelling);
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(clean_env fail open_gz);
 
-use Text::ParseWords ();
-use File::Basename;
-
 sub run {
 
 my ($pkg, undef, $info, $proc, $group) = @_;
@@ -369,7 +370,7 @@ foreach my $depproc (@{ $ginfo->direct_dependencies ($proc) }) {
 
 for my $f (sort keys %binary) {
     if (exists $manpage{$f}) {
-        if (not grep { $_->{lang} eq '' } @{$manpage{$f}}) {
+        if (none { $_->{lang} eq '' } @{$manpage{$f}}) {
             tag 'binary-without-english-manpage', "$binary{$f}";
         }
     } else {
diff --git a/checks/menu-format b/checks/menu-format
index aa74615..873e66d 100644
--- a/checks/menu-format
+++ b/checks/menu-format
@@ -36,12 +36,13 @@ package Lintian::menu_format;
 use strict;
 use warnings;
 
+use File::Basename;
+use List::MoreUtils qw(any);
+
 use Lintian::Data;
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(fail);
 
-use File::Basename;
-
 # This is a list of all tags that should be in every menu item.
 my @req_tags=qw(needs section title command);
 
@@ -770,7 +771,7 @@ sub VerifyCmd {
             || $info->index ($cmd_file)
             || $cmd =~ m,^(/bin/)?sh,
             || $cmd =~ m,^(/usr/bin/)?sensible-(pager|editor|browser),
-            || grep { $info->index ($_ . $cmd) } @path);
+            || any { $info->index ($_ . $cmd) } @path);
     return ($okay, $cmd_file);
 }
 
diff --git a/checks/nmu b/checks/nmu
index 9450dbe..547aef9 100644
--- a/checks/nmu
+++ b/checks/nmu
@@ -22,6 +22,9 @@ package Lintian::nmu;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
+use List::Util qw(first);
+
 use Lintian::Tags qw(tag);
 
 sub run {
@@ -46,7 +49,7 @@ my ($entry) = $info->changelog->data;
 my $uploader = canonicalize($entry->Maintainer);
 my $changes = $entry->Changes;
 $changes =~ s/^(\s*\n)+//;
-my $firstline = (grep /^\s*\*/, split('\n', $changes))[0];
+my $firstline = first { /^\s*\*/ } split ('\n', $changes);
 
 # Check the first line for QA, NMU or team upload mentions.
 if ($firstline) {
@@ -89,7 +92,7 @@ if ($version =~ /local/i) {
 my $upload_is_nmu = $uploader ne $maintainer;
 if (defined $uploaders) {
     my @uploaders = map { canonicalize($_) } split />\K\s*,\s*/, $uploaders;
-    $upload_is_nmu = 0 if grep /^\s*\Q$uploader\E\s*$/, @uploaders;
+    $upload_is_nmu = 0 if any { /^\s*\Q$uploader\E\s*$/ } @uploaders;
 }
 
 if ($maintainer =~ /packages\@qa.debian.org/) {
diff --git a/checks/rules b/checks/rules
index 6f5d2d1..637dfa7 100644
--- a/checks/rules
+++ b/checks/rules
@@ -17,6 +17,8 @@ package Lintian::rules;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
+
 use Lintian::Data;
 use Lintian::Tags qw(tag);
 use Lintian::Util qw(fail rstrip);
@@ -300,7 +302,7 @@ while (<RULES>) {
                 $seen{$target}++ if $required{$target};
                 $seen{$target}++ if $recommended{$target};
             }
-            if (grep { $target =~ /$_/ } @arch_rules) {
+            if (any { $target =~ /$_/ } @arch_rules) {
                 push (@arch_rules, @depends);
             }
         }
@@ -320,8 +322,8 @@ while (<RULES>) {
             for my $target (@current_targets) {
                 $rules_per_target{$target} ||= [];
                 push @{$rules_per_target{$target}}, $_;
-                $arch = 1 if (grep { $target =~ /$_/ } @arch_rules);
-                $indep = 1 if (grep { $target =~ /$_/ } @indep_rules);
+                $arch = 1 if (any { $target =~ /$_/ } @arch_rules);
+                $indep = 1 if (any { $target =~ /$_/ } @indep_rules);
                 $indep = 1 if $target eq '%';
                 $indep = 1 if $target =~ /^override_/;
             }
diff --git a/checks/scripts b/checks/scripts
index 0e80c55..e859437 100644
--- a/checks/scripts
+++ b/checks/scripts
@@ -26,6 +26,8 @@ package Lintian::scripts;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
+
 use Lintian::Check qw($known_shells_regex);
 use Lintian::Data;
 use Lintian::Relation;
@@ -997,7 +999,7 @@ for my $divert (keys %added_diversions) {
 
     if ($expand_diversions) {
         tag 'diversion-for-unknown-file', $divert, "$script:$line"
-            unless (grep { $_ =~ m/$divertrx/ } $info->sorted_index);
+            unless (any { $_ =~ m/$divertrx/ } $info->sorted_index);
     } else {
         tag 'diversion-for-unknown-file', $divert, "$script:$line"
             unless $info->index ($divert);
diff --git a/checks/shared-libs b/checks/shared-libs
index 3d8b799..c9377a2 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -23,6 +23,7 @@ use strict;
 use warnings;
 
 use File::Basename;
+use List::MoreUtils qw(any none);
 
 use Lintian::Data;
 use Lintian::Relation;
@@ -126,7 +127,7 @@ for my $cur_file ($info->sorted_index) {
         }
 
         my @symbol_names = map { @{$_}[2] } @{$objdump->{$cur_file}->{SYMBOLS}};
-        if ((grep /^_?exit$/, @symbol_names) && (!grep $_ eq 'fork', @symbol_names)) {
+        if ((any { m/^_?exit$/ } @symbol_names) && (none { $_ eq 'fork' } @symbol_names)) {
             # If it has an INTERP section it might be an application with
             # a SONAME (hi openjdk-6, see #614305).  Also see the comment
             # for "shlib-with-executable-bit" below.
diff --git a/checks/source-copyright b/checks/source-copyright
index e3b508e..d2bba97 100644
--- a/checks/source-copyright
+++ b/checks/source-copyright
@@ -23,6 +23,7 @@ package Lintian::source_copyright;
 use strict;
 use warnings;
 
+use List::MoreUtils qw(any);
 use Text::Levenshtein qw(distance);
 
 use Lintian::Relation::Version qw(versions_compare);
@@ -211,7 +212,7 @@ if (@dep5) {
     }
     if ($commas_in_files) {
         tag 'comma-separated-files-in-dep5-copyright', 'paragraph at line', $lines[$commas_in_files]
-            unless grep(/,/, $info->sorted_index);
+            unless any {m/,/} $info->sorted_index;
     }
     while ((my $license, $i) = each %required_standalone_licenses) {
         if (not defined $standalone_licenses{$license}) {
diff --git a/debian/changelog b/debian/changelog
index f580aca..f88f481 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -168,6 +168,7 @@ lintian (2.5.12) UNRELEASED; urgency=low
       to work around #677530.
     + [NT] Add XS-Testsuite for autopkgtest tests.
     + [NT] Add Build-Depends on libtest-perl-critic-perl.
+    + [NT] Add (Build-)Depends on liblist-moreutils-perl.
   * debian/lintian.install:
     + [NT] Install Test::Lintian in /usr/share/lintian/lib.
   * debian/rules:
diff --git a/debian/control b/debian/control
index d24b56e..58bdf47 100644
--- a/debian/control
+++ b/debian/control
@@ -33,6 +33,7 @@ Build-Depends: binutils,
                libemail-valid-perl,
                libhtml-parser-perl,
                libipc-run-perl,
+               liblist-moreutils-perl,
                libparse-debianchangelog-perl,
                libtest-minimumversion-perl,
                libtest-perl-critic-perl,
@@ -81,6 +82,7 @@ Depends: binutils,
          libdpkg-perl,
          libemail-valid-perl,
          libipc-run-perl,
+         liblist-moreutils-perl,
          libparse-debianchangelog-perl,
          libtext-levenshtein-perl,
          libtimedate-perl,
diff --git a/frontend/lintian b/frontend/lintian
index 8a4fabe..6e3522b 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -26,8 +26,8 @@ use strict;
 use warnings;
 
 use Cwd qw(abs_path);
-
 use Getopt::Long;
+use List::MoreUtils qw(any);
 use POSIX qw(:sys_wait_h);
 
 # }}}
@@ -358,7 +358,7 @@ sub record_display_level {
     $op = '=' unless defined $op;
     $rel = '=' unless defined $rel;
     if (not defined $certainty) {
-        if (grep { $severity eq $_ } @certainties) {
+        if (any { $severity eq $_ } @certainties) {
             $certainty = $severity;
             undef $severity;
         }
@@ -1550,7 +1550,7 @@ sub _find_changes {
         while ( my $line = <$foreign> ) {
             chomp $line;
             # Skip already attempted architectures (e.g. via DEB_BUILD_ARCH)
-            next if grep { $_ eq $line } @archs;
+            next if any { $_ eq $line } @archs;
             push @archs, $line;
         }
         close $foreign;
diff --git a/lib/Lintian/DepMap.pm b/lib/Lintian/DepMap.pm
index a331263..0bdbd99 100644
--- a/lib/Lintian/DepMap.pm
+++ b/lib/Lintian/DepMap.pm
@@ -19,6 +19,7 @@ use strict;
 use warnings;
 
 use parent 'Clone';
+use List::MoreUtils qw(any);
 
 use Lintian::Util qw(fail);
 
@@ -211,7 +212,7 @@ sub satisfy {
     my $self = shift;
     my $node = shift;
 
-    if (grep {$_ eq $node} $self->missing()) {
+    if (any {$_ eq $node} $self->missing()) {
         fail("Attempted to mark node '$node' as satisfied but it is not ".
                     'reachable, perhaps you forgot to add() it first?');
     }
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 08551a1..e01d753 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -23,6 +23,7 @@ use strict;
 use warnings;
 
 use Exporter qw(import);
+use List::MoreUtils qw(any);
 
 use Lintian::Architecture qw(:all);
 use Lintian::Output;
@@ -738,7 +739,7 @@ sub displayed {
     # of this tag occur in display_source.
     if (keys %{ $self->{display_source} }) {
         my @sources = $info->sources;
-        unless (grep { $self->{display_source}{$_} } @sources) {
+        unless (any { $self->{display_source}{$_} } @sources) {
             $display = 0;
         }
     }

-- 
Debian package checker


Reply to: