The following commit has been merged in the master branch:
commit 8ff2a9eb06ac0b60a11e837e8633f186177771ac
Author: Adam D. Barratt <[EMAIL PROTECTED]>
Date:   Fri Jun 20 23:51:40 2008 +0100

    Ensure that menu-method files use "!include menu.h" (Closes: #184104)

diff --git a/checks/menus b/checks/menus
index 7216d84..6674d33 100644
--- a/checks/menus
+++ b/checks/menus
@@ -132,7 +132,20 @@ while (<IN>) {
            # is made executable in the postinst as recommended by
            # the menu manual
 
+           my $menumethod_includes_menu_h = 0;
            $menumethod_file = $file;
+
+           open(MM, '<', "unpacked/$file") or fail("cannot open menu-method 
file $file: $!");
+           while (<MM>) {
+               chomp;
+               if (m,^!include menu.h,o) {
+                   $menumethod_includes_menu_h = 1;
+                   last;
+               }
+           }
+           close MM;
+           tag "menu-method-should-include-menu-h", "$file"
+               unless $menumethod_includes_menu_h or $pkg eq 'menu';
        }
     }
 }
diff --git a/checks/menus.desc b/checks/menus.desc
index 07d233b..14eaec4 100644
--- a/checks/menus.desc
+++ b/checks/menus.desc
@@ -307,3 +307,9 @@ Info: The section indicated in this doc-base control file 
is not one of
  the standard doc-base sections.  The doc-base sections are based on the
  menu sections but are not exactly the same.
 Ref: Debian doc-base Manual section 2.3.3
+
+Tag: menu-method-should-include-menu-h
+Type: error
+Info: A menu-method file must include the menu.h configuration file
+ (using "!include menu.h").
+Ref: Debian Menu System manual 5
diff --git a/debian/changelog b/debian/changelog
index 5fadc09..41b29b5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ lintian (1.24.2) unstable; urgency=low
       non-obsolete alternatives specified and if the obsolete
       package is not listed first.  Issue an info tag for them
       though.  Patch by Adam D. Barratt.  (Closes: #486145)
+  * checks/menus:
+    + [ADB] Check that menu-method files include menu.h (Closes: #184104)
   * checks/scripts:
     + [FL] Apply File::Spec->canonpath() to rpaths to improve
       matching with directories.
diff --git a/testset/binary/debian/conffiles b/testset/binary/debian/conffiles
new file mode 100644
index 0000000..d1a0843
--- /dev/null
+++ b/testset/binary/debian/conffiles
@@ -0,0 +1 @@
+/etc/menu-methods/lintian
diff --git a/testset/binary/debian/menu-method 
b/testset/binary/debian/menu-method
new file mode 100644
index 0000000..9f07bd7
--- /dev/null
+++ b/testset/binary/debian/menu-method
@@ -0,0 +1,22 @@
+#!/usr/bin/install-menu
+
+#   -*- mode: shell-script; -*-
+#I need menu-1!
+#
+
+!include notmenu.h
+ 
+compat="menu-2"
+
+outputencoding="UTF-8";
+outputlanguage="C";
+
+x11 = AppEntry("false");
+text = AppEntry("true");
+
+startmenu = "";
+endmenu = "";
+submenutitle = "";
+rootprefix = "/var/lib/lintian/menu";
+userprefix = ".local/share/lintian/menu";
+
diff --git a/testset/binary/debian/rules b/testset/binary/debian/rules
index a89ce60..33d83f6 100755
--- a/testset/binary/debian/rules
+++ b/testset/binary/debian/rules
@@ -40,6 +40,8 @@ binary-arch: build
        install -d $(tmp)/usr/share/binary
        install -m 644 debian/menu $(tmp)/usr/share/menu/binary
        install -m 644 debian/menu $(tmp)/usr/lib/menu/binary
+       install -d $(tmp)/etc/menu-methods
+       install -m 755 debian/menu-method $(tmp)/etc/menu-methods/lintian
        install -d $(tmp)/usr/share/doc-base
        install -m 644 debian/doc-base $(tmp)/usr/share/doc-base/binary
        touch '$(tmp)/usr/share/doc-base/space '
@@ -51,6 +53,7 @@ binary-arch: build
        #gzip -9 $(tmp)/usr/share/doc/binary/changelog
        install -d $(tmp)/DEBIAN
        install -m 755 debian/postinst $(tmp)/DEBIAN
+       install -m 644 debian/conffiles $(tmp)/DEBIAN
 
        install -d $(tmp)/usr/share/applications
        install -m 644 debian/hello.desktop \
diff --git a/testset/tags.binary b/testset/tags.binary
index e47f4fd..7819d9c 100644
--- a/testset/tags.binary
+++ b/testset/tags.binary
@@ -28,6 +28,7 @@ E: binary: menu-item-missing-required-tag needs 
/usr/lib/menu/binary:6
 E: binary: menu-item-missing-required-tag needs /usr/share/menu/binary:6
 E: binary: menu-item-missing-required-tag section /usr/lib/menu/binary:1
 E: binary: menu-item-missing-required-tag section /usr/share/menu/binary:1
+E: binary: menu-method-should-include-menu-h etc/menu-methods/lintian
 E: binary: non-wm-in-windowmanager-menu-section x11 /usr/lib/menu/binary:4
 E: binary: non-wm-in-windowmanager-menu-section x11 /usr/share/menu/binary:4
 E: binary: non-wm-module-in-wm-modules-menu-section wm /usr/lib/menu/binary:22

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to