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

[SCM] Debian package checker branch, master, updated. 1.24.2-75-gf4ccb0c



The following commit has been merged in the master branch:
commit f4ccb0ca089f4a58df9640ee2206133d2f09a770
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Tue Aug 5 01:24:37 2008 +0100

    Convert to Lintian::Collect
    
      * checks/menus:
        + [ADB] Use the file list from Lintian::Collect.

diff --git a/checks/menus b/checks/menus
index 6674d33..d332437 100644
--- a/checks/menus
+++ b/checks/menus
@@ -31,6 +31,7 @@ use Tags;
 use Util;
 
 my $pkg;
+my $info;
 my %all_files = ();
 my %all_links = ();
 
@@ -53,6 +54,7 @@ sub run {
 
 $pkg = shift;
 my $type = shift;
+$info = shift;
 
 my %preinst;
 my %postinst;
@@ -89,21 +91,17 @@ if ( -f "control/postrm" ) {
 }
 
 # read package contents
-open(IN, '<', "index") or fail("cannot open index file index: $!");
-while (<IN>) {
-    chomp;
-    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
-    $file =~ s,^(\./),,;
-    add_file_link_info ($file);
-    $file =~ s/ link to .*//;
-    $file =~ s/ -> .*//;
+for my $file (sort keys %{$info->index}) {
+    next if $file eq "";
 
-    my $operm = perm2oct($perm);
+    add_file_link_info ($file);
+    my $index_info = $info->index->{$file};
+    my $operm = $index_info->{operm};
 
-    if ($perm =~ m,^-,o) { # file checks
+    if ($index_info->{type} =~ m,^[-h],) { # file checks
 	# menu file?
 	if ($file =~ m,^usr/(lib|share)/menu/\S,o) { # correct permissions?
-	    if ($perm =~ m,x,o) {
+	    if ($operm & 01 or $operm & 010 or $operm & 0100) {
 		tag "executable-menu-file", sprintf("$file %04o",$operm);
 	    }
 
@@ -121,7 +119,7 @@ while (<IN>) {
 	}
 	# doc-base file?
 	elsif ($file =~ m,^usr/share/doc-base/\S,o) { # correct permissions?
-	    if ($perm =~ m,x,o) {
+	    if ($operm & 01 or $operm & 010 or $operm & 0100) {
 		tag "executable-in-usr-share-docbase", $file, sprintf("%04o",$operm);
 	    }
 	    $docbase_file = $file;
@@ -337,11 +335,11 @@ sub check_doc_base_field {
             tag "doc-base-index-references-multiple-files", "$dbfile:$line";
         }
         for my $file (@files) {
+	    next if $file eq '';
             if ($file =~ m%^/usr/doc%) {
                 tag "doc-base-file-references-usr-doc", "$dbfile:$line";
             }
             my $realfile = delink ($file);
-
             # openoffice.org-dev-doc has thousands of files listed so try to
             # use the hash if possible.
             my $found;
@@ -489,15 +487,15 @@ sub check_doc_base_file_section {
 sub add_file_link_info {
     my $file = shift;
     my $link = undef;
+    $link = $info->index->{$file}->{link};
+    my $ishard = ($info->index->{$file}->{type} eq 'h');
 
     $file = "/" . $file if (not $file =~ m%^/%); # make file absolute
     $file =~ s%/+%/%g;				 # remove duplicated `/'
-    my $ishard = ($file =~ / link to /);
-    ($file, $link) = split(/ (?:->|link to) /, $file);
-
     $all_files{$file} = 1;
 
     if (defined $link) {
+	$link = './' . $link if $link !~ m,^/,;
 	if ($ishard) {
 	    $link =~ s,^\./,/,;
 	} elsif (not $link =~ m,^/,) {		  # not absolute link
diff --git a/debian/changelog b/debian/changelog
index 339f991..d85fd6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -71,8 +71,9 @@ lintian (1.24.3) unstable; urgency=low
       or 'sh'.  Thanks Raphael Geissert.
     + [RA] Warn about .kdelnk files and [KDE Desktop Entry] headings in
       desktop files.  Patch from Raphael Geissert.
-  * checks/menus.desc:
+  * checks/menus{,.desc}:
     + [ADB] Fix a typo; thanks Jordà Polo.
+    + [ADB] Use the file list from Lintian::Collect.
   * checks/nmu{,.desc}:
     + [ADB] Use Lintian::Collect for maintainer / uploader information
     + [ADB] Add a DevRef reference to changelog-should-mention-nmu.  Thanks

-- 
Debian package checker


Reply to: