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

[lintian] 02/03: c/java: Optimise a loop limit



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit fcc87fbc6466433f4eb0ece66bd2bcaba6b7e1da
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Oct 22 10:53:00 2016 +0000

    c/java: Optimise a loop limit
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/java.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/checks/java.pm b/checks/java.pm
index 43e3e57..e8a55be 100644
--- a/checks/java.pm
+++ b/checks/java.pm
@@ -243,8 +243,12 @@ sub run {
     my $is_transitional = $info->is_pkg_class('transitional');
     if (!$has_public_jars && !$is_transitional && $pkg =~ /^lib[^\s,]+-java$/){
         # Skip this if it installs a symlink in usr/share/java
-        return if any { m@^usr/share/java/[^/]+\.jar$@o } $info->sorted_index;
-        tag 'javalib-but-no-public-jars';
+        my $java_dir = $info->index_resolved_path('usr/share/java/');
+        my $has_jars = 0;
+        $has_jars = 1
+          if $java_dir
+          and any { $_->name =~ m@^[^/]+\.jar$@o } $java_dir->children;
+        tag 'javalib-but-no-public-jars' if not $has_jars;
     }
 
     return;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: