[lintian] 02/02: c/{infofiles, testsuite}.pm: Use new L::Path features
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 7558a6fd9924921833707531ce3ecfa528387965
Author: Niels Thykier <niels@thykier.net>
Date: Wed Sep 17 22:21:06 2014 +0200
c/{infofiles,testsuite}.pm: Use new L::Path features
Signed-off-by: Niels Thykier <niels@thykier.net>
---
checks/infofiles.pm | 10 ++++++----
checks/testsuite.pm | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/checks/infofiles.pm b/checks/infofiles.pm
index 3616739..92fddd0 100644
--- a/checks/infofiles.pm
+++ b/checks/infofiles.pm
@@ -81,11 +81,13 @@ sub run {
# If this is the main info file (no numeric extension). make
# sure it has appropriate dir entry information.
if ($fname !~ /-\d+\.gz/ && $file_info =~ /gzip compressed data/) {
- if ($file->is_symlink && !is_ancestor_of($info->unpacked, $file)) {
- # unsafe symlink, skip
+ if (!$file->is_valid_path) {
+ # unsafe symlink, skip. Actually, this should never
+ # be true as "$file_info" for symlinks will not be
+ # "gzip compressed data". But for good measure.
next;
}
- my $fd = open_gz($info->unpacked($file));
+ my $fd = $file->open_gz;
local $_;
my ($section, $start, $end);
while (<$fd>) {
@@ -112,7 +114,7 @@ sub run {
# filename sought.
#
if ($file->is_file && $fname =~ /\.info(?:-\d+)?\.gz$/) {
- my $fd = open_gz($info->unpacked($file));
+ my $fd = $file->open_gz;
while (my $line = <$fd>) {
while ($line =~ /[\0][\b]\[image src="((?:\\.|[^\"])+)"/smg) {
my $src = $1;
diff --git a/checks/testsuite.pm b/checks/testsuite.pm
index 0cea9ea..008e764 100644
--- a/checks/testsuite.pm
+++ b/checks/testsuite.pm
@@ -76,7 +76,7 @@ sub run {
# that the file itself is not a symlink. These two facts
# _combined_ means we can skip the is_ancestor_of check
# here.
- my $path = $info->unpacked($control);
+ my $path = $control->fs_path;
my $not_utf8_line = file_is_encoded_in_non_utf8($path);
if ($not_utf8_line) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: