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

lintian: r123 - in trunk: checks debian testset testset/binary/debian



Author: he
Date: 2004-04-07 23:50:01 +0200 (Wed, 07 Apr 2004)
New Revision: 123

Modified:
   trunk/checks/menu-format
   trunk/checks/menu-format.desc
   trunk/debian/changelog
   trunk/testset/binary/debian/menu
   trunk/testset/info_tags.binary
   trunk/testset/tags.binary
Log:
Check if the command given with command= is in the package (Closes: #199346)



Modified: trunk/checks/menu-format
===================================================================
--- trunk/checks/menu-format	2004-04-05 01:27:28 UTC (rev 122)
+++ trunk/checks/menu-format	2004-04-07 21:50:01 UTC (rev 123)
@@ -309,6 +309,14 @@
 	    print "W: $pkg $type: menu-item-contains-unknown-tag $tag /usr/lib/menu/$menufile:$linecount\n";
 	}
     }
+
+    # Read the file index:
+    my %file_index;
+    open(FILE_INDEX,"index") or fail("cannot open index file index: $!");
+    while(<FILE_INDEX>) {
+	$file_index{(split /\s*/, $_)[5]} = 1;
+    }
+    close FILE_INDEX;
     
 	my @com=split(' ',$vals{'command'});
 	if ($com[0] eq "su-to-root") {
@@ -325,7 +333,15 @@
 	    }
 	    if (! defined($com[0]) || $com[0] ne '-c') {
 		print "E: $pkg $type: su-to-root-without--c /usr/lib/menu/$menufile:$linecount\n";
+		print "W: $pkg $type: menu-command-not-in-package /usr/lib/menu/$menufile:$linecount\n"
+		    if ($com[0] && !$file_index{$com[0]});
+	    } else {   
+		print "W: $pkg $type: menu-command-not-in-package /usr/lib/menu/$menufile:$linecount\n"
+		    if ($com[1] && !$file_index{$com[1]});
 	    }
+	} else { 	
+	    print "W: $pkg $type: menu-command-not-in-package /usr/lib/menu/$menufile:$linecount\n"
+	        if ($com[0] && !$file_index{$com[0]});
 	}
 
     if (exists($vals{'icon'})) {

Modified: trunk/checks/menu-format.desc
===================================================================
--- trunk/checks/menu-format.desc	2004-04-05 01:27:28 UTC (rev 122)
+++ trunk/checks/menu-format.desc	2004-04-07 21:50:01 UTC (rev 123)
@@ -175,3 +175,9 @@
 Info: The menu item includes a tag with an unquoted string like section=Games
  instead of section="Games". This is deprecated. Use a quoted string instead.
 Ref: menu 3.1
+
+Tag: menu-command-not-in-package
+Type: warning
+Info: The menu item specifies a command which is not available in the package.
+ In most cases this is a typo or after you moved a binary around, but forgot
+ to update the menu file.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-04-05 01:27:28 UTC (rev 122)
+++ trunk/debian/changelog	2004-04-07 21:50:01 UTC (rev 123)
@@ -19,6 +19,8 @@
       from the location of the binary. (Closes: #203831)
   * checks/menu-format:
     + [FL] Only issue one warning about needs=dwww, not two
+    + [HE] Check if the command given with command= is in the package
+      (Closes: #199346)
   * checks/scripts:
     + [FL] Add /usr/bin/php as valid interpreter. (Closes: #239115)
       Thanks to Peter Eisentraut for pointing this change out

Modified: trunk/testset/binary/debian/menu
===================================================================
--- trunk/testset/binary/debian/menu	2004-04-05 01:27:28 UTC (rev 122)
+++ trunk/testset/binary/debian/menu	2004-04-07 21:50:01 UTC (rev 123)
@@ -3,3 +3,4 @@
 ?package(binary):needs="text" section="Apps/System" title="Run cfdisk (1)" command="/usr/sbin/su-to-root -p cfdisk"
 ?package(binary):needs="x11" section="WindowManagers" title="Run xfdisk" command="su-to-root -c xfdisk"
 ?package(binary):needs="wm" section="Apps/System" title="Run fdisk-wm" command="/usr/bin/su-to-root cfdisk"
+?package(binary):needs="text" section="Apps/System" title="I'm not here!" command="/imnothere"

Modified: trunk/testset/info_tags.binary
===================================================================
--- trunk/testset/info_tags.binary	2004-04-05 01:27:28 UTC (rev 122)
+++ trunk/testset/info_tags.binary	2004-04-07 21:50:01 UTC (rev 123)
@@ -94,6 +94,12 @@
 N:   The menu item command uses su-to-root without the -c flag. This is a
 N:   syntax error, see su-to-root(1) for more information.
 N:
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:2
+N:
+N:   The menu item specifies a command which is not available in the
+N:   package. In most cases this is a typo or after you moved a binary
+N:   around, but forgot to update the menu file.
+N:
 E: binary: su-to-root-without--c /usr/lib/menu/binary:3
 E: binary: su-to-root-without-usr-sbin /usr/lib/menu/binary:4
 N:
@@ -127,6 +133,7 @@
 N:   This may be intentional, but it's probably a typo that will make menu
 N:   ignore the line.
 N:
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:6
 E: binary: unstripped-binary-or-object ./usr/bin/hello
 N:
 N:   The package installs an unstripped binary or object file.

Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary	2004-04-05 01:27:28 UTC (rev 122)
+++ trunk/testset/tags.binary	2004-04-07 21:50:01 UTC (rev 123)
@@ -12,11 +12,13 @@
 E: binary: menu-item-missing-required-tag section /usr/lib/menu/binary:1
 W: binary: unquoted-string-in-menu-item /usr/lib/menu/binary needs:2
 E: binary: su-to-root-without--c /usr/lib/menu/binary:2
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:2
 E: binary: su-to-root-without--c /usr/lib/menu/binary:3
 E: binary: su-to-root-without-usr-sbin /usr/lib/menu/binary:4
 E: binary: non-wm-in-windowmanager-menu-section x11 /usr/lib/menu/binary:4
 E: binary: su-to-root-with-usr-bin /usr/lib/menu/binary:5
 W: binary: menu-item-needs-tag-has-unknown-value wm /usr/lib/menu/binary:5
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:6
 E: binary: unstripped-binary-or-object ./usr/bin/hello
 E: binary: statically-linked-binary ./usr/bin/static-hello
 E: binary: changelog-file-not-compressed changelog



Reply to: