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

[SCM] Debian package checker branch, master, updated. 1.24.2-61-gfa13d15



The following commit has been merged in the master branch:
commit fa13d15f9af4c003a8fa4dde1cc1e5af0b82f32a
Author: Adam D. Barratt <adam@adam-barratt.org.uk>
Date:   Thu Jul 31 21:23:28 2008 +0100

    Replace "index" parsing with Lintian::Collect::index
    
    * checks/menu-format:
      + [ADB] Use Lintian::Collect to parse the list of files in the package.

diff --git a/checks/menu-format b/checks/menu-format
index ecd2d7b..fd03b31 100644
--- a/checks/menu-format
+++ b/checks/menu-format
@@ -384,6 +384,7 @@ sub run {
 
 my $pkg = shift;
 my $type = shift;
+my $info = shift;
 
 my @menufiles;
 opendir (MENUDIR, "menu/lib") or fail("cannot read menu/lib file directory.");
@@ -397,26 +398,24 @@ closedir MENUDIR;
 # of every file in the package to use to verify that the command referenced by
 # a menu item or desktop entry is there.
 my @desktop_files;
-open(IN, '<', "index") or fail("cannot open index file index: $!");
-while (<IN>) {
-    chomp;
-    my ($perm, $owner, $size, $date, $time, $file) = split(' ', $_, 6);
-    $file =~ s,^\./,/,;
-    $file =~ s/ link to .*//;
-    $file =~ s/ -> .*//;
-    my $operm = perm2oct($perm);
+foreach my $file (keys %{$info->index}) {
+    my $index_info = $info->index->{$file};
+    my $operm = $index_info->{operm};
+
+    $file = '/' . $file;
     $file_index{$file} = 1;
 
-    if ($perm =~ m,^-, && $file =~ m,/usr/share/applications/.*\.desktop$,) {
-        if ($perm =~ m,x,o) {
-            tag "executable-desktop-file", sprintf("$file %04o",$operm);
-        }
-        unless (m,template,) {
+    if ($index_info->{type} eq '-' &&
+	$file =~ m,/usr/share/applications/.*\.desktop$,) {
+
+	if ($operm & 0100 or $operm & 010 or $operm & 01) {
+           tag "executable-desktop-file", sprintf("$file %04o",$operm);
+	}
+        unless ($file =~ m,template,) {
             push (@desktop_files, $file);
         }
     }
 }
-close IN;
 
 # Verify all the desktop files.
 for my $desktop_file (@desktop_files) {
diff --git a/debian/changelog b/debian/changelog
index 393b35a..f9f0479 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -61,6 +61,8 @@ lintian (1.24.3) unstable; urgency=low
       a URL.  URLs often can't be usefully broken.  Based on a patch by
       Damyan Ivanov.  (Closes: #491578)
     + [ADB] Update the Policy reference for manpage-has-wrong-extension.
+  * checks/menu-format:
+    + [ADB] Use Lintian::Collect to parse the list of files in the package.
   * checks/menus.desc:
     + [ADB] Fix a typo; thanks Jordà Polo.
   * checks/nmu{,.desc}:

-- 
Debian package checker


Reply to: