[lintian] 01/01: c/infofiles: Optimise 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 be3e81a26fd3ded059c630f2a00723f5e7d9e2f1
Author: Niels Thykier <niels@thykier.net>
Date: Sat Oct 22 10:34:49 2016 +0000
c/infofiles: Optimise loop limit
Signed-off-by: Niels Thykier <niels@thykier.net>
---
checks/infofiles.pm | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/checks/infofiles.pm b/checks/infofiles.pm
index 707c541..1825f70 100644
--- a/checks/infofiles.pm
+++ b/checks/infofiles.pm
@@ -27,20 +27,19 @@ use autodie;
use Lintian::Tags qw(tag);
use Lintian::Util qw(fail open_gz normalize_pkg_path);
-use File::Basename qw(fileparse);
-
sub run {
my (undef, undef, $info) = @_;
+ my $info_dir = $info->index_resolved_path('usr/share/info/');
+
+ return if not $info_dir;
# Read package contents...
- foreach my $file ($info->sorted_index) {
+ foreach my $file ($info_dir->children('breadth-first')) {
# NB: file_info can be undef (e.g. symlinks)
my $file_info = $file->file_info // '';
- my ($fname, $path) = fileparse($file);
+ my $fname = $file->name;
- next
- unless ($file->is_symlink or $file->is_file)
- and ($path =~ m,^usr/share/info/, or $path =~ m,^usr/info/,);
+ next unless $file->is_symlink or $file->is_file;
# Ignore dir files. That's a different error which we already catch in
# the files check.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: