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

[lintian] 01/02: checks/python.pm: Fix false positives in python-package-missing-depends-on-python for Python 3 packages.



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 12dce096c5aaf1ad6c49f1d8e636fc2567d64eb2
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Jan 16 17:41:24 2018 +1100

    checks/python.pm: Fix false positives in python-package-missing-depends-on-python for Python 3 packages.
---
 checks/python.pm | 21 +++++++++++++++------
 debian/changelog |  5 +++++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/checks/python.pm b/checks/python.pm
index 339b260..6756600 100644
--- a/checks/python.pm
+++ b/checks/python.pm
@@ -36,6 +36,12 @@ my %DJANGO_PACKAGES = (
     '^python3-django-' => 'python3-django',
     '^python2?-django-' => 'python-django',
 );
+
+my %REQUIRED_DEPENDS = (
+    'python2' => 'python-minimal:any | python:any',
+    'python3' => 'python3-minimal:any | python3:any',
+);
+
 my %MISMATCHED_SUBSTVARS = (
     '^python3-.+' => '${python:Depends}',
     '^python2?-.+' => '${python3:Depends}',
@@ -103,12 +109,15 @@ sub _run_binary {
         $info->relation('provides'), $pkg);
     my @entries = $info->changelog ? $info->changelog->data : ();
 
-    if (
-        any { m,^usr/lib/python[\d.]+/(?:site|dist)-packages, }
-        $info->sorted_index
-        and not $deps->implies('python:any | python-minimal:any')
-      ) {
-        tag 'python-package-missing-depends-on-python';
+    # Check for missing dependencies
+    foreach my $file ($info->sorted_index) {
+        if (    $file->is_file
+            and $file
+            =~ m,usr/lib/(?<version>python[23])[\d.]*/(?:site|dist)-packages,
+            and not $deps->implies($REQUIRED_DEPENDS{$+{version}})) {
+            tag 'python-package-missing-depends-on-python';
+            last;
+        }
     }
 
     # Python 2 modules
diff --git a/debian/changelog b/debian/changelog
index db25e7d..2cd7092 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ lintian (2.5.70) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/python.pm:
+    + [CL] Fix false positives in python-package-missing-depends-on-python
+      for Python 3 packages; we were not checking python3:any or
+      python3-minimal:any.
+
  -- Chris Lamb <lamby@debian.org>  Tue, 16 Jan 2018 12:08:07 +1100
 
 lintian (2.5.69) unstable; urgency=medium

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: