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

lintian: r253 - in trunk: checks debian testset



Author: djpig
Date: 2004-05-04 02:37:38 +0200 (Tue, 04 May 2004)
New Revision: 253

Modified:
   trunk/checks/menu-format
   trunk/debian/changelog
   trunk/testset/tags.binary
Log:
Fix su-to-root checks to cope with the new -X option and
improve the option parsing to better handle unknown options


Modified: trunk/checks/menu-format
===================================================================
--- trunk/checks/menu-format	2004-05-04 00:36:22 UTC (rev 252)
+++ trunk/checks/menu-format	2004-05-04 00:37:38 UTC (rev 253)
@@ -317,19 +317,32 @@
 	    tag "su-to-root-with-usr-bin", "/usr/lib/menu/$menufile:$linecount";
 	} elsif ($com[0] eq "/usr/sbin/su-to-root") {
 	    shift @com;
-	    # This is _so_ going to break on every parameter added to
-	    # su-to-root... But alas --Jeroen
-	    if (defined($com[0]) && $com[0] eq '-p') {
-		shift @com;
-		shift @com;
-	    }
-	    if (! defined($com[0]) || $com[0] ne '-c') {
+	    
+            my $cmd;
+            while (@com) {
+                if ($com[0]) {
+                    if ($com[0] eq '-p') {
+                        shift @com;
+                        shift @com;
+                    } elsif ($com[0] eq '-X') {
+                        shift @com;
+                    } elsif ($com[0] eq '-c') {
+                        $cmd = $com[1];
+                        shift @com;
+                        shift @com;
+                    } else {
+                        shift @com;
+                    }
+                } else {
+                    shift @com;
+                }
+            }
+            
+            unless ($cmd) {
 		tag "su-to-root-without--c", "/usr/lib/menu/$menufile:$linecount";
-		tag "menu-command-not-in-package", "/usr/lib/menu/$menufile:$linecount"
-		    if ($com[0] && !$file_index{".$com[0]"});
 	    } else {   
 		tag "menu-command-not-in-package", "/usr/lib/menu/$menufile:$linecount"
-		    if ($com[1] && !$file_index{".$com[1]"});
+		    if (!$file_index{".$cmd"});
 	    }
 	} else {
 	    tag "menu-command-not-in-package", "/usr/lib/menu/$menufile:$linecount $com[0]"

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2004-05-04 00:36:22 UTC (rev 252)
+++ trunk/debian/changelog	2004-05-04 00:37:38 UTC (rev 253)
@@ -10,6 +10,9 @@
   * checks/fields{,.desc}:
     + [JvW] Added debian-revision-should-not-be-zero, suggested by Adam
       Conrad
+  * checks/menu-format:
+    + [FL] Fix su-to-root checks to cope with the new -X option and
+      improve the option parsing to better handle unknown options
   * checks/shared-libs:
     + [FL] Don't report shlib-with-executable-bit and
       shlib-with-bad-permissions on symbolic links to such files

Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary	2004-05-04 00:36:22 UTC (rev 252)
+++ trunk/testset/tags.binary	2004-05-04 00:37:38 UTC (rev 253)
@@ -19,7 +19,6 @@
 W: binary source: ancient-standards-version 3.2.1
 W: binary source: maintainer-upload-has-incorrect-version-number 4-1.1
 W: binary source: native-package-with-dash-version
-W: binary: menu-command-not-in-package /usr/lib/menu/binary:2
 W: binary: menu-command-not-in-package /usr/lib/menu/binary:6 /imnothere
 W: binary: menu-item-needs-tag-has-unknown-value wm /usr/lib/menu/binary:5
 W: binary: package-contains-upstream-install-documentation usr/share/doc/binary/INSTALL



Reply to: