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

lintian: r622 - trunk/checks



Author: rra
Date: 2006-04-17 00:48:02 +0200 (Mon, 17 Apr 2006)
New Revision: 622

Modified:
   trunk/checks/rules
Log:
Fix a few bugs in the rule scanning uncovered by running it against a
fraction of the archive:  Allow -r and -e in the #!/usr/bin/make -f
line of debian/rules even though it's not strictly permitted by policy.
Recognize makefile targets specified in a space-separated list before
the first colon in a line.


Modified: trunk/checks/rules
===================================================================
--- trunk/checks/rules	2006-04-16 19:56:56 UTC (rev 621)
+++ trunk/checks/rules	2006-04-16 22:48:02 UTC (rev 622)
@@ -38,10 +38,11 @@
 
 open(RULES, '< debfiles/rules') or fail("Failed opening rules: $!");
 
-# Check for required #!/usr/bin/make -f opening line.
+# Check for required #!/usr/bin/make -f opening line.  Allow -r or -e; a
+# strict reading of Policy doesn't allow either, but they seem harmless.
 my $start = <RULES>;
 tag "debian-rules-not-a-makefile", ""
-    unless $start =~ m%^\#!\s*/usr/bin/make\s+-f\s*$%;
+    unless $start =~ m%^\#!\s*/usr/bin/make\s+-[re]?f[re]?\s*$%;
 
 # Scan debian/rules.  We would really like to let make do this for us, but
 # unfortunately there doesn't seem to be a way to get make to syntax-check and
@@ -57,10 +58,11 @@
     $includes = 1 if /^ *[s-]?include\s+/;
 
     # We're looking only for the required targets.  Ignore everything else.
-    next unless /^([^\s:]+):/;
-    my $target = $1;
-    next unless $required{$target};
-    $seen{$target}++;
+    next unless /^([^:]+):/;
+    my @targets = split (' ', $1);
+    for (@targets) {
+        $seen{$_}++ if $required{$_};
+    }
 }
 close RULES;
 



Reply to: