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

[SCM] Debian package checker branch, master, updated. 2.5.11-68-g39d1d98



The following commit has been merged in the master branch:
commit 39d1d98f1fd5fb7f0f9711595fa915f511c09132
Author: Thomas Preud'homme <robotux@celest.fr>
Date:   Wed Jan 16 11:57:51 2013 +0100

    c/menu-format: Check for relative menu icon paths
    
    [nthykier:
     * Reformat code to use "tag X unless Y"
     * Update/implement tests
    ]
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/menu-format b/checks/menu-format
index a1447b9..aa74615 100644
--- a/checks/menu-format
+++ b/checks/menu-format
@@ -525,6 +525,9 @@ sub VerifyIcon {
         return;
     }
 
+    tag 'menu-icon-uses-relative-path', $icon
+        unless $icon =~ m,^/,;
+
     $icon =~ s|^/*||og;
 
     if (not ($icon =~ m/\.xpm$/i)) {
diff --git a/checks/menu-format.desc b/checks/menu-format.desc
index 495cfec..10dbbc5 100644
--- a/checks/menu-format.desc
+++ b/checks/menu-format.desc
@@ -130,6 +130,13 @@ Certainty: certain
 Info: Icons in the Debian menu system should be in XPM format.
 Ref: menu 3.7
 
+Tag: menu-icon-uses-relative-path
+Severity: normal
+Certainty: certain
+Info: This package contains a menu file which references an icon by a relative
+ path. However, icons should be referenced by an absolute path in menu files.
+Ref: menu 3.2, #693477
+
 Tag: menu-icon-missing
 Severity: normal
 Certainty: possible
diff --git a/debian/changelog b/debian/changelog
index d44ee65..deefc13 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ lintian (2.5.12) UNRELEASED; urgency=low
       - dir-or-file-in-etc-opt
       - dir-or-file-in-home
       - license-problem-gfdl-invariants
+      - menu-icon-uses-relative-path
 
   * checks/binaries{,.desc}:
     + [NT] Accept libx32 as a bi-arch directory.
@@ -33,6 +34,8 @@ lintian (2.5.12) UNRELEASED; urgency=low
       the report.  (Closes: #693918)
     + [NT] Apply patch from Matthias Klumpp to add missing
       "Science" category.  (Closes: #697693)
+    + [NT] Apply patch from Thomas Preud'homme to detect uses of
+      relative icons in menu files.  (Closes: #697916)
 
   * collection/strings:
     + [NT] Fix a regression in filtering out "debug" ELF binaries.
diff --git a/t/tests/menu-format-general/debian/debian/menu-cmd.menu b/t/tests/menu-format-general/debian/debian/menu-cmd.menu
index 78b9cae..73bc14c 100644
--- a/t/tests/menu-format-general/debian/debian/menu-cmd.menu
+++ b/t/tests/menu-format-general/debian/debian/menu-cmd.menu
@@ -1,4 +1,4 @@
 ?package(menu-cmd):needs="X11" section="Applications/Programming"\
   title="pargs (png icon)" command="/usr/bin/not-here"\
-  longtitle="Argument printer" icon16x16="pargs.png" \
-  icon="broken.xpm" icon32x32="too-large.xpm"
+  longtitle="Argument printer" icon16x16="/usr/share/pixmaps/pargs.png" \
+  icon="/usr/share/pixmaps/broken.xpm" icon32x32="/usr/share/pixmaps/too-large.xpm"
diff --git a/t/tests/menu-format-general/debian/debian/menu-none.menu b/t/tests/menu-format-general/debian/debian/menu-none.menu
index 440ffb5..4bd3892 100644
--- a/t/tests/menu-format-general/debian/debian/menu-none.menu
+++ b/t/tests/menu-format-general/debian/debian/menu-none.menu
@@ -5,6 +5,12 @@
 ?package(menu-none):needs="X11" section="Applications/Programming"\
   title="pargs (mis. icon)" command="/usr/bin/pargs"\
   longtitle="Argument printer"\
-  icon="non-existent.xpm"\
+  icon="/usr/share/menu-none/non-existent.xpm"\
   icon32x32="/usr/share/menu-none/non-existent32.xpm"\
   icon16x16="/usr/share/menu-none/non-existent16.xpm"
+?package(menu-none):needs="X11" section="Applications/Programming"\
+  title="pargs (rel. icon)" command="/usr/bin/pargs"\
+  longtitle="Argument printer"\
+  icon="non-existent.xpm"\
+  icon32x32="non-existent32.xpm"\
+  icon16x16="non-existent16.xpm"
diff --git a/t/tests/menu-format-general/desc b/t/tests/menu-format-general/desc
index e380e89..084d031 100644
--- a/t/tests/menu-format-general/desc
+++ b/t/tests/menu-format-general/desc
@@ -15,6 +15,7 @@ Test-For:
  menu-item-uses-apps-games-section
  menu-item-uses-apps-section
  menu-item-uses-icon-none
+ menu-icon-uses-relative-path
  menu-item-uses-windowmanagers-section
  non-wm-in-windowmanager-menu-section
  pkg-not-in-package-test
diff --git a/t/tests/menu-format-general/tags b/t/tests/menu-format-general/tags
index 5ca3ae0..bf5aa1e 100644
--- a/t/tests/menu-format-general/tags
+++ b/t/tests/menu-format-general/tags
@@ -1,16 +1,22 @@
 E: menu-broken: bad-test-in-menu-item usr/share/menu/menu-broken:4
 E: menu-broken: unparsable-menu-item usr/share/menu/menu-broken:12
-E: menu-cmd: menu-icon-not-in-xpm-format pargs.png
-E: menu-cmd: menu-icon-too-big too-large.xpm: 256x256 > 32x32
+E: menu-cmd: menu-icon-not-in-xpm-format usr/share/pixmaps/pargs.png
+E: menu-cmd: menu-icon-too-big usr/share/pixmaps/too-large.xpm: 256x256 > 32x32
 E: menu-section: menu-item-creates-new-root-section Root usr/share/menu/menu-section:3
 E: menu-section: non-wm-in-windowmanager-menu-section x11 usr/share/menu/menu-section:15
 W: menu-broken: duplicated-tag-in-menu-item usr/share/menu/menu-broken longtitle:12
 W: menu-broken: pkg-not-in-package-test wrong-package usr/share/menu/menu-broken
 W: menu-cmd: menu-command-not-in-package usr/share/menu/menu-cmd:4 usr/bin/not-here
-W: menu-cmd: menu-icon-cannot-be-parsed broken.xpm: looking for XPM header
+W: menu-cmd: menu-icon-cannot-be-parsed usr/share/pixmaps/broken.xpm: looking for XPM header
 W: menu-none: menu-icon-missing non-existent.xpm
+W: menu-none: menu-icon-missing non-existent16.xpm
+W: menu-none: menu-icon-missing non-existent32.xpm
+W: menu-none: menu-icon-missing usr/share/menu-none/non-existent.xpm
 W: menu-none: menu-icon-missing usr/share/menu-none/non-existent16.xpm
 W: menu-none: menu-icon-missing usr/share/menu-none/non-existent32.xpm
+W: menu-none: menu-icon-uses-relative-path non-existent.xpm
+W: menu-none: menu-icon-uses-relative-path non-existent16.xpm
+W: menu-none: menu-icon-uses-relative-path non-existent32.xpm
 W: menu-none: menu-item-uses-icon-none usr/share/menu/menu-none:4
 W: menu-section: menu-item-creates-new-section Games usr/share/menu/menu-section:9
 W: menu-section: menu-item-creates-new-section WindowManagers/Programming usr/share/menu/menu-section:15

-- 
Debian package checker


Reply to: