[SCM] Debian package checker branch, master, updated. 2.5.12-17-gcc20490
The following commit has been merged in the master branch:
commit c8051fc38262e4a055c1216272360ebdb9320521
Author: Niels Thykier <niels@thykier.net>
Date: Sat Apr 20 16:33:10 2013 +0200
checks/*: Pass Lintian::Path objects to unpacked/control
When a Lintian::Path object is already available, pass it to unpacked
(or control) instead of the filename.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/files b/checks/files
index c77e07b..049d12c 100644
--- a/checks/files
+++ b/checks/files
@@ -348,7 +348,7 @@ foreach my $file ($info->sorted_index) {
#----------------- /etc/php5/conf.d
elsif ($file =~ m,^etc/php5/conf.d/.+\.ini$,) {
if ($index_info->is_file) {
- open (PHPINI, '<', $info->unpacked($file)) or fail("cannot open .ini file: $!");
+ open (PHPINI, '<', $info->unpacked($index_info)) or fail("cannot open .ini file: $!");
while (<PHPINI>) {
next unless (m/^\s*#/);
tag 'obsolete-comments-style-in-php-ini', $file;
@@ -413,9 +413,9 @@ foreach my $file ($info->sorted_index) {
# gzipped zero byte files:
# 276 is 255 bytes (maximal length for a filename) + gzip overhead
if ($file =~ m,.gz$, and $index_info->size <= 276
- and $index_info->is_file
- and $info->file_info ($file) =~ m/gzip compressed/) {
- my $fd = open_gz ($info->unpacked ($file)) or fail "open $file: $!";
+ and $index_info->is_file
+ and $info->file_info ($file) =~ m/gzip compressed/) {
+ my $fd = open_gz ($info->unpacked($index_info)) or fail "open $file: $!";
my $f = <$fd>;
close $fd;
unless (defined $f and length $f) {
@@ -796,7 +796,7 @@ foreach my $file ($info->sorted_index) {
{
my $dep = $info->relation('strong');
if ($index_info->is_file && $file =~ m,\.pm$, && !$dep->implies ('libperl4-corelibs-perl | perl (<< 5.12.3-7)')) {
- open (PM, '<', $info->unpacked($file)) or fail("cannot open .pm file: $!");
+ open (PM, '<', $info->unpacked($index_info)) or fail("cannot open .pm file: $!");
while (<PM>) {
if (/(?:do|require)\s+(?:'|")(abbrev|assert|bigfloat|bigint|bigrat|cacheout|complete|ctime|dotsh|exceptions|fastcwd|find|finddepth|flush|getcwd|getopt|getopts|hostname|importenv|look|newgetopt|open2|open3|pwd|shellwords|stat|syslog|tainted|termcap|timelocal|validate)\.pl(?:'|")/) {
tag 'perl-module-uses-perl4-libs-without-dep', "$file:$. ${1}.pl";
@@ -997,7 +997,7 @@ foreach my $file ($info->sorted_index) {
# ---------------- embedded Feedparser library
if ($file =~ m,/feedparser\.py$, and $pkg ne 'python-feedparser') {
- open(FEEDPARSER, '<', $info->unpacked($file)) or fail("cannot open feedparser.py file: $!");
+ open(FEEDPARSER, '<', $info->unpacked($index_info)) or fail("cannot open feedparser.py file: $!");
while (<FEEDPARSER>) {
if (m,Universal feed parser,) {
tag 'embedded-feedparser-library', $file;
@@ -1010,7 +1010,7 @@ foreach my $file ($info->sorted_index) {
# ---------------- embedded PEAR modules
foreach my $pearmodule (@pearmodules) {
if ($file =~ m,/$pearmodule->[0], and $pkg ne $pearmodule->[1]) {
- open (PEAR, '<', $info->unpacked($file)) or fail("cannot open PHP file: $!");
+ open (PEAR, '<', $info->unpacked($index_info)) or fail("cannot open PHP file: $!");
while (<PEAR>) {
if (m,/pear[/.],i) {
tag 'embedded-pear-module', $file;
@@ -1039,7 +1039,7 @@ foreach my $file ($info->sorted_index) {
}
my $finfo = $info->file_info ($file) || '';
if ($finfo =~ m/PostScript Type 1 font program data/) {
- my $path = $info->unpacked ($file);
+ my $path = $info->unpacked($index_info);
open my $t1pipe, '-|', 't1disasm', $path or fail "Can't pipe from t1disasm: $!";
my $foundadobeline = 0;
while (my $line = <$t1pipe>) {
@@ -1081,7 +1081,7 @@ foreach my $file ($info->sorted_index) {
if ($finfo !~ m/gzip compressed/) {
tag 'gz-file-not-gzip', $file;
} elsif ($isma_same && $file !~ m/\Q$arch\E/o) {
- my $path = $info->unpacked ($file);
+ my $path = $info->unpacked($index_info);
open my $fd, '<', $path or fail "opening $file: $!";
my $buff;
# We need to read at least 8 bytes
diff --git a/checks/infofiles b/checks/infofiles
index 788bf5e..581ca87 100644
--- a/checks/infofiles
+++ b/checks/infofiles
@@ -80,7 +80,7 @@ foreach my $file ($info->sorted_index) {
# unsafe symlink, skip
next;
}
- my $fd = open_gz ($info->unpacked ($file));
+ my $fd = open_gz ($info->unpacked($index_info));
fail "open_gz $file: $!" unless defined $fd;
local $_;
my ($section, $start, $end);
diff --git a/checks/manpages b/checks/manpages
index 0f6c1eb..7995494 100644
--- a/checks/manpages
+++ b/checks/manpages
@@ -158,7 +158,7 @@ foreach my $file ($info->sorted_index) {
}
}
} else { # not a symlink
- my $path = $info->unpacked($file);
+ my $path = $info->unpacked($index_info);
my $fd;
if ($file_info =~ m/gzip compressed/) {
$fd = open_gz($path)
diff --git a/checks/shared-libs b/checks/shared-libs
index aaf5324..08076b5 100644
--- a/checks/shared-libs
+++ b/checks/shared-libs
@@ -166,7 +166,7 @@ for my $cur_file ($info->sorted_index) {
tag 'sharedobject-in-library-directory-missing-soname', $cur_file;
} elsif ($cur_file =~ m/\.la$/ and not defined $cur_file_data->link) {
local $_;
- open(LAFILE, '<', $info->unpacked($cur_file))
+ open(LAFILE, '<', $info->unpacked($cur_file_data))
or fail("Could not open $cur_file for reading!");
while(<LAFILE>) {
next unless (m/^(libdir)='(.+?)'$/) or (m/^(dependency_libs)='(.+?)'$/);
diff --git a/checks/testsuite b/checks/testsuite
index e8dd64e..cae6bb3 100644
--- a/checks/testsuite
+++ b/checks/testsuite
@@ -63,7 +63,7 @@ sub run {
if (not $control->is_regular_file) {
tag 'debian-tests-control-is-not-a-regular-file';
} else {
- my $path = $info->unpacked ($control->name);
+ my $path = $info->unpacked($control);
my $not_utf8_line = file_is_encoded_in_non_utf8 ($path, $type, $pkg);
if ($not_utf8_line) {
diff --git a/debian/changelog b/debian/changelog
index bb521a7..d9b5814 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
lintian (2.5.13) UNRELEASED; urgency=low
+ * checks/*:
+ + [NT] Use Lintian::Path objects as arguments to unpacked
+ and control where these objects are available.
* checks/changes:
+ [NT] Recognise "<dist>-backports-sloppy" as a valid
distribution. Thanks to Romain Francoise for the
--
Debian package checker
Reply to: