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

lintian: r688 - in trunk: checks debian testset testset/debug/debian



Author: rra
Date: 2006-06-25 07:20:07 +0200 (Sun, 25 Jun 2006)
New Revision: 688

Modified:
   trunk/checks/debhelper
   trunk/debian/changelog
   trunk/testset/debug/debian/control
   trunk/testset/tags.debug
Log:
* checks/debhelper:
  + [RA] Use the Dep library to check debhelper build dependencies
    rather than parsing Build-Depends with regexes.  This avoids false
    positives due to matching package names ending in debhelper.
    Reported by Fabio Tranchitella.  (Closes: #366531)

Modified: trunk/checks/debhelper
===================================================================
--- trunk/checks/debhelper	2006-06-25 05:01:06 UTC (rev 687)
+++ trunk/checks/debhelper	2006-06-25 05:20:07 UTC (rev 688)
@@ -133,8 +133,10 @@
     }
 }
 
-# If we got this far, they need to have #DEBHELPER# in their scripts.
-# search for scripts that look like maintainer scripts.
+# If we got this far, they need to have #DEBHELPER# in their scripts.  Search
+# for scripts that look like maintainer scripts.  Also collect dependency
+# information from debian/control and check compatibility level.
+my $depends;
 opendir(DEBIAN, 'debfiles')
     or fail("Can't open debfiles directory.");
 while (defined(my $file=readdir(DEBIAN))) {
@@ -174,22 +176,19 @@
 	open(IN,"debfiles/$file")
 	    or fail("Can't open debfiles/$file: $!");
 	while (<IN>) {
-	    if (m/^(Build-Depends|Build-Depends-Indep):/i) {
-		if (m,debhelper\s*\(\s*>(?:>|=)\s*([^)]+),) {  
-		    $seenversiondepends = $1;
-	        }
-	    }
-	    if ($needbuilddepends and m/debhelper/) {
-		$needbuilddepends = 0; # seen them, all is good
-	    }
+	    if (s/^(Build-Depends|Build-Depends-Indep):\s*//i) {
+                $depends .= ', ' if $depends;
+                $depends .= $_;
+            }
 	    if (m/^\s*$/) { # end of first stanza
 		last;
 	    }
-	}
-	if ($needbuilddepends) {
+        }
+	close IN;
+        $depends = Dep::parse($depends);
+        if ($needbuilddepends && ! Dep::implies($depends, Dep::parse('debhelper'))) {
 	    tag "package-uses-debhelper-but-lacks-build-depends", "";
 	}
-	close IN;
     } elsif ($file =~ m/^ex\.|\.ex$/i) {
         tag "dh-make-template-in-source", "debian/$file";
     }
@@ -204,7 +203,7 @@
     tag "package-uses-deprecated-debhelper-compat-version", $needversiondepends;
 }
 
-if ($needversiondepends > 4 and ! Dep::versions_lte($needversiondepends, $seenversiondepends)) {
+if ($needversiondepends > 4 and ! Dep::implies($depends, Dep::parse("debhelper (>= $needversiondepends)"))) {
     tag "package-lacks-versioned-build-depends-on-debhelper", $needversiondepends;
 }
 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-06-25 05:01:06 UTC (rev 687)
+++ trunk/debian/changelog	2006-06-25 05:20:07 UTC (rev 688)
@@ -9,6 +9,11 @@
       templates.  (Closes: #368206)
   * checks/common_data.pm:
     + [RA] Add amd64 to the standard architectures.  (Closes: #367324)
+  * checks/debhelper:
+    + [RA] Use the Dep library to check debhelper build dependencies
+      rather than parsing Build-Depends with regexes.  This avoids false
+      positives due to matching package names ending in debhelper.
+      Reported by Fabio Tranchitella.  (Closes: #366531)
   * checks/fields:
     + [RA] Allow build-depend on quilt if clean depends on the xsfclean
       rule, for packages maintained by the X Strike Force.

Modified: trunk/testset/debug/debian/control
===================================================================
--- trunk/testset/debug/debian/control	2006-06-25 05:01:06 UTC (rev 687)
+++ trunk/testset/debug/debian/control	2006-06-25 05:20:07 UTC (rev 688)
@@ -3,6 +3,7 @@
 Priority: optional
 Maintainer: Russ Allbery <rra@debian.org>
 Build-Depends: debhelper (>= 5.0.0)
+Build-Depends-Indep: not-debhelper (>= 0.4.3)
 Standards-Version: 3.7.0
 
 Package: hello

Modified: trunk/testset/tags.debug
===================================================================
--- trunk/testset/tags.debug	2006-06-25 05:01:06 UTC (rev 687)
+++ trunk/testset/tags.debug	2006-06-25 05:20:07 UTC (rev 688)
@@ -1,3 +1,4 @@
+E: debug source: build-depends-indep-without-arch-indep
 E: hello: statically-linked-binary ./usr/bin/hello.dbg
 E: hello: unstripped-binary-or-object ./usr/bin/hello.dbg
 E: libhello0-dbg: binary-with-bad-dynamic-table ./usr/lib/libhello.so.dbg



Reply to: