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

[SCM] Debian package checker branch, master, updated. 2.5.6-119-ga0dacdc



The following commit has been merged in the master branch:
commit a0dacdcd226866bcc33e059b620aeb16a27db8a4
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Apr 22 16:43:39 2012 +0200

    c/menu-format: Check strong depends for menu icon
    
    If a package is missing a menu icon, check its direct strong
    dependencies built from the same source (if any) for the icon.  This
    fixes false-positives menu-icon-missing in some cases.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/menu-format b/checks/menu-format
index 9120ce8..4c13843 100644
--- a/checks/menu-format
+++ b/checks/menu-format
@@ -328,6 +328,8 @@ sub run {
 my $pkg = shift;
 my $type = shift;
 my $info = shift;
+my $proc = shift;
+my $group = shift;
 
 my @menufiles;
 opendir (MENUDIR, 'menu/lib') or fail('cannot read menu/lib file directory.');
@@ -411,11 +413,11 @@ foreach my $menufile (@menufiles) {
         # Note that I allow whitespace after the continuation character.
         # This is caught by VerifyLine().
         if (! ($menufile_line =~ m/\\\s*?$/)) {
-            VerifyLine($pkg, $info, $type, $menufile, $fullname, $line, $lc);
+            VerifyLine($pkg, $info, $proc, $group, $type, $menufile, $fullname, $line, $lc);
             $line='';
         }
     } while ($menufile_line = <IN>);
-    VerifyLine($pkg, $info, $type, $menufile, $fullname, $line, $lc);
+    VerifyLine($pkg, $info, $proc, $group, $type, $menufile, $fullname, $line, $lc);
 
     close IN;
 }
@@ -427,7 +429,7 @@ foreach my $menufile (@menufiles) {
 # Pass this a line of a menu file, it sanitizes it and
 # verifies that it is correct.
 sub VerifyLine {
-    my ($pkg, $info, $type, $menufile, $fullname, $line, $linecount) = @_;
+    my ($pkg, $info, $proc, $group, $type, $menufile, $fullname, $line, $linecount) = @_;
 
     my %vals;
 
@@ -567,13 +569,13 @@ sub VerifyLine {
                 or ($section =~ m:^(WindowManagers/Modules|FVWM Modules|Window Maker):));
 
     if (exists($vals{'icon'})) {
-        VerifyIcon($info, $menufile, $fullname, $linecount, $vals{'icon'}, 32);
+        VerifyIcon($info, $proc, $group, $menufile, $fullname, $linecount, $vals{'icon'}, 32);
     }
     if (exists($vals{'icon32x32'})) {
-        VerifyIcon($info, $menufile, $fullname, $linecount, $vals{'icon32x32'}, 32);
+        VerifyIcon($info, $proc, $group, $menufile, $fullname, $linecount, $vals{'icon32x32'}, 32);
     }
     if (exists($vals{'icon16x16'})) {
-        VerifyIcon($info, $menufile, $fullname, $linecount, $vals{'icon16x16'}, 16);
+        VerifyIcon($info, $proc, $group, $menufile, $fullname, $linecount, $vals{'icon16x16'}, 16);
     }
 
     # Check the needs tag.
@@ -637,7 +639,7 @@ sub VerifyLine {
 
 
 sub VerifyIcon {
-    my ($info, $menufile, $fullname, $linecount, $icon, $size) = @_;
+    my ($info, $proc, $group, $menufile, $fullname, $linecount, $icon, $size) = @_;
     local *IN;
 
     if ($icon eq 'none') {
@@ -656,6 +658,16 @@ sub VerifyIcon {
     my $iconfile = $info->unpacked($icon);
     if (! -f $iconfile) {
         $iconfile = $info->unpacked("/usr/share/pixmaps/$icon");
+        if (! -f $iconfile) {
+            my $ginfo = $group->info;
+            foreach my $depproc (@{ $ginfo->direct_dependencies ($proc) }) {
+                my $dinfo = $depproc->info;
+                $iconfile = $dinfo->unpacked($icon);
+                last if -f $iconfile;
+                $iconfile = $info->unpacked("/usr/share/pixmaps/$icon");
+                last if -f $iconfile;
+            }
+        }
     }
 
     if (! open (IN, '<', $iconfile)) {
diff --git a/debian/changelog b/debian/changelog
index ce395bf..01b579c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -108,6 +108,9 @@ lintian (2.5.7) UNRELEASED; urgency=low
       change.  Thanks, Iustin Pop.  (Closes: #664471)
   * checks/menu-format:
     + [NT] Move menu section lists into a data file.
+    + [NT] If a package is missing a menu icon, check its direct strong
+      dependencies built from the same source (if any) for the icon.
+      This fixes false-positives menu-icon-missing in some cases.
   * checks/menus{,.desc}:
     + [NT] Remove "manual" lazy load of data file.
   * checks/nmu:

-- 
Debian package checker


Reply to: