[SCM] Debian package checker branch, master, updated. 1.24.2-55-g227ab1f
The following commit has been merged in the master branch:
commit 227ab1fde1122c78070fc96976bd100ad8e0f794
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date: Wed Jul 30 21:00:37 2008 +0100
Use Lintian::Collect::{file_info,index}
Replace direct parsing of file-info and index with ::Collect
diff --git a/checks/changelog-file b/checks/changelog-file
index f72a2b6..e2879dc 100644
--- a/checks/changelog-file
+++ b/checks/changelog-file
@@ -44,24 +44,12 @@ my @doc_files;
my %file_info;
my %is_a_symlink;
-# Read file info...
-open(IN, '<', "file-info")
- or fail("cannot find file-info for $type package $pkg");
-while (<IN>) {
- chop;
-
- m/^(.*?):\s+(.*)$/o or
- fail("an error in the file pkg is preventing lintian from checking this package: $_");
- my ($file,$info) = ($1,$2);
-
+# Modify the file_info by following symbolic links.
+for my $file (keys %{$info->file_info}) {
next unless $file =~ m/doc/o;
- $file =~ s,^(\./)?,,;
- $file_info{$file} = $info;
-}
-close(IN);
-# Modify the file_info by following symbolic links.
-for my $file (keys %file_info) {
+ $file_info{$file} = $info->file_info->{$file};
+
if ($file_info{$file} =~ m/^(?:broken )?symbolic link to (.*)/) {
$is_a_symlink{$file} = 1;
# Figure out the link destination. This algorithm is
@@ -83,8 +71,8 @@ for my $file (keys %file_info) {
# concatenate the results
$newfile .= '/' . $link;
}
- if (exists $file_info{$newfile}) {
- $file_info{$file} = $file_info{$newfile};
+ if (exists $info->file_info->{$newfile}) {
+ $file_info{$file} = $info->file_info->{$newfile};
}
}
}
@@ -93,13 +81,10 @@ for my $file (keys %file_info) {
# together at random it seems here
# Read package contents...
-open(IN, '<', "index") or fail("cannot open index file index: $!");
-while (<IN>) {
- chop;
-
- s,^(\./),,;
+foreach (keys %{$info->index}) {
+ next unless length $_;
# skip packages which have a /usr/share/doc/$pkg -> foo symlink
- if (m, usr/share/doc/$ppkg -> ,) {
+ if (m,usr/share/doc/$ppkg$, and defined $info->index->{$_}->{link}) {
return 0;
}
@@ -148,7 +133,6 @@ while (<IN>) {
# next unless m,^(\S+).*usr/share/doc/$ppkg/([^/\s]+)( -> [^/\s]+)?$,o;
}
-close(IN);
# ignore packages which don't have a /usr/share/doc/$pkg directory, since
# the copyright check will complain about this
diff --git a/debian/changelog b/debian/changelog
index 87b9dbc..e88aa1d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,7 +4,8 @@ lintian (1.24.3) unstable; urgency=low
+ [ADB] Use Lintian::Collect throughout rather than reparsing file-info
and objdump-info.
* checks/changelog-file:
- + [ADB] Use Lintian::Collect::field() instead of reading the fields/ files
+ + [ADB] Use Lintian::Collect instead of reading the fields/*, file-info
+ and objdump-info files.
* checks/copyright-file{,.desc}:
+ [ADB] Drop the "copyright line too long" check. Most of the issues
it flags aren't easily fixable, particularly where the copyright file
--
Debian package checker
Reply to: