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

lintian: r726 - in trunk: checks debian testset testset/debconf/debian



Author: rra
Date: 2006-08-20 04:59:09 +0200 (Sun, 20 Aug 2006)
New Revision: 726

Added:
   trunk/testset/debconf/debian/pycompat
Modified:
   trunk/checks/debhelper
   trunk/checks/debhelper.desc
   trunk/debian/changelog
   trunk/testset/tags.debconf
   trunk/testset/tags.scripts
Log:
  + [RA] Warn if dh_python is used without debian/pycompat in non-CDBS
    packages and check for the debhelper version required for Python
    policy.  Thanks, Rapha?\195?\171l Hertzog.  (Closes: #375318)

Modified: trunk/checks/debhelper
===================================================================
--- trunk/checks/debhelper	2006-08-20 01:39:21 UTC (rev 725)
+++ trunk/checks/debhelper	2006-08-20 02:59:09 UTC (rev 726)
@@ -40,6 +40,8 @@
 my $seenversiondepends = '0';
 my $compat = '';
 my $usescdbs = '';
+my $seendhpython = '';
+my $usescdbspython = '';
 
 # If there is no debian/compat file present but cdbs is being used, cdbs will
 # create one automatically.  Currently it always uses compatibility level 4.
@@ -113,6 +115,11 @@
     } elsif (/^\s*DH_COMPAT\s*:?=\s*(\d+)/) {
 	$dhcompatvalue = $1;
     }
+    if (/^\s+dh_python\s/) {
+        $seendhpython = 1;
+    } elsif (m,^include\s+/usr/share/cdbs/1/class/python-distutils.mk,) {
+        $usescdbspython = 1;
+    }
 }
 close RULES;
 
@@ -190,6 +197,23 @@
 }
 closedir(DEBIAN);
 
+# Check for Python policy usage and the required debhelper dependency for
+# dh_python policy support.  Assume people who intentionally set pycompat to
+# something earlier than 2 know what they're doing.  Skip CDBS packages since
+# CDBS creates pycompat internally at build time.
+if ($seendhpython && !$usescdbspython) {
+    if (open(PYCOMPAT, "debfiles/pycompat")) {
+	local $/;
+	my $pycompat = <PYCOMPAT>;
+	close PYCOMPAT;
+	if ($pycompat >= 2 && ! Dep::implies($depends, Dep::parse('debhelper (>= 5.0.37.2)'))) {
+	    tag "package-needs-python-policy-debhelper", "";
+	}
+    } else {
+	tag "uses-dh-python-with-no-pycompat", "";
+    }
+}
+
 if ($usescdbs and not $needversiondepends) {
     $needversiondepends = $cdbscompat;
 }

Modified: trunk/checks/debhelper.desc
===================================================================
--- trunk/checks/debhelper.desc	2006-08-20 01:39:21 UTC (rev 725)
+++ trunk/checks/debhelper.desc	2006-08-20 02:59:09 UTC (rev 726)
@@ -82,3 +82,17 @@
  <tt>debian/compat</tt> or by setting and exporting DH_COMPAT in
  <tt>debian/rules</tt>.  If it is not set in either place, debhelper
  defaults to the deprecated compatibility version 1.
+
+Tag: package-needs-python-policy-debhelper
+Type: error
+Info: The source package requests dh_python compatibility level 2 (or
+ higher) in <tt>debian/pycompat</tt> but doesn't depend on a new enough
+ debhelper.  A Build-Depends on debhelper (>= 5.0.37.2) is required for
+ this support.
+
+Tag: uses-dh-python-with-no-pycompat
+Type: warning
+Info: This package uses dh_python but apparently does not tell it to use
+ the current Python policy by putting 2 in <tt>debian/pycompat</tt>.  This
+ may mean that the package has not been converted to the current Python
+ policy, in which case it probably should be.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-08-20 01:39:21 UTC (rev 725)
+++ trunk/debian/changelog	2006-08-20 02:59:09 UTC (rev 726)
@@ -22,6 +22,9 @@
   * checks/debhelper:
     + [RA] Use the standard control file parser rather than a custom
       parser that can't handle continuation lines.
+    + [RA] Warn if dh_python is used without debian/pycompat in non-CDBS
+      packages and check for the debhelper version required for Python
+      policy.  Thanks, Raphaël Hertzog.  (Closes: #375318)
   * checks/fields{.desc,}:
     + [RA] Don't warn virtual-package-depends-without-real-package-depends
       for Recommends and rewrite the tag description to be more accurate.
@@ -107,7 +110,7 @@
     + [RA] Include the lintian version in HTML page footers.  Thanks,
       Thijs Kinkhorst.  (Closes: #377616)
 
- -- Russ Allbery <rra@debian.org>  Sat, 19 Aug 2006 18:13:48 -0700
+ -- Russ Allbery <rra@debian.org>  Sat, 19 Aug 2006 19:58:42 -0700
 
 lintian (1.23.22) unstable; urgency=low
 

Added: trunk/testset/debconf/debian/pycompat
===================================================================
--- trunk/testset/debconf/debian/pycompat	2006-08-20 01:39:21 UTC (rev 725)
+++ trunk/testset/debconf/debian/pycompat	2006-08-20 02:59:09 UTC (rev 726)
@@ -0,0 +1 @@
+2

Modified: trunk/testset/tags.debconf
===================================================================
--- trunk/testset/tags.debconf	2006-08-20 01:39:21 UTC (rev 725)
+++ trunk/testset/tags.debconf	2006-08-20 02:59:09 UTC (rev 726)
@@ -1,5 +1,6 @@
 E: debconf source: declares-possibly-conflicting-debhelper-compat-versions rules=4 compat=4
 E: debconf source: missing-dh_python-build-dependency python | python-dev | python-all-dev
+E: debconf source: package-needs-python-policy-debhelper
 E: debconf-test: extended-description-is-empty
 E: debconf-test: mismatch-translated-choices debconf/testmulti choices-de.utf-8
 E: debconf-test: no-template-description debconf/no-description

Modified: trunk/testset/tags.scripts
===================================================================
--- trunk/testset/tags.scripts	2006-08-20 01:39:21 UTC (rev 725)
+++ trunk/testset/tags.scripts	2006-08-20 02:59:09 UTC (rev 726)
@@ -14,6 +14,7 @@
 W: scripts source: changelog-should-mention-nmu
 W: scripts source: package-uses-deprecated-debhelper-compat-version 1
 W: scripts source: source-nmu-has-incorrect-version-number 6
+W: scripts source: uses-dh-python-with-no-pycompat
 W: scripts: binary-without-manpage lefty-foo
 W: scripts: binary-without-manpage make-foo
 W: scripts: binary-without-manpage perl-bizarre-1



Reply to: