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

[lintian] 01/04: Don't emit new-package-should-not-package-python2-module if the maintainer justifies its inclusion in the changelog entry.



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

lamby pushed a commit to branch master
in repository lintian.

commit a8a93458a41626db1ec160acd5e377e6d7370ab0
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Jan 9 22:26:45 2018 +0530

    Don't emit new-package-should-not-package-python2-module if the maintainer justifies its inclusion in the changelog entry.
---
 checks/python.desc                                 |  4 ++++
 checks/python.pm                                   |  9 +++++---
 debian/changelog                                   |  4 ++++
 .../debian/debian/changelog.in                     | 10 ++++++++
 .../debian/debian/control.in                       | 27 ++++++++++++++++++++++
 t/tests/python-new-python2-package-unrel/desc      |  5 ++++
 t/tests/python-new-python2-package-unrel/tags      |  0
 7 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/checks/python.desc b/checks/python.desc
index b95ad64..e8d0ed1 100644
--- a/checks/python.desc
+++ b/checks/python.desc
@@ -22,6 +22,10 @@ Info: This package appears to be the initial packaging of a new upstream
  .
  This warning can also be ignored if the package is not intended for Debian or
  if it is a split of an existing Debian package.
+ .
+ Please add a justification to your changelog entry; Lintian looks in this
+ version's changelog entry for the relevant package name or the phrase
+ "Python 2 version" or similar.
 
 Tag: python-foo-but-no-python3-foo
 Severity: normal
diff --git a/checks/python.pm b/checks/python.pm
index 85f3511..bb44163 100644
--- a/checks/python.pm
+++ b/checks/python.pm
@@ -102,9 +102,12 @@ sub _run_binary {
     my @entries = $info->changelog ? $info->changelog->data : ();
 
     # Python 2 modules
-    if ($pkg =~ /^python2?-/ and none { $pkg =~ /$_$/ } @IGNORE) {
-        tag 'new-package-should-not-package-python2-module'
-          if @entries == 1;
+    if (    $pkg =~ /^python2?-/
+        and none { $pkg =~ /$_$/ } @IGNORE
+        and @entries == 1
+        and $entries[0]->Changes !~ /\bpython 2(\.x)? (variant|version)\b/im
+        and index($entries[0]->Changes, $pkg) == -1) {
+        tag 'new-package-should-not-package-python2-module';
     }
 
     # Python applications
diff --git a/debian/changelog b/debian/changelog
index c35f68a..34fff4e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,10 @@ lintian (2.5.69) UNRELEASED; urgency=medium
 
   XXX: generate tag summary
 
+  * checks/python.pm:
+    + [CL] Don't emit new-package-should-not-package-python2-module if
+      the maintainer justifies its inclusion in the changelog entry.
+
  -- Chris Lamb <lamby@debian.org>  Tue, 09 Jan 2018 20:55:21 +0530
 
 lintian (2.5.68) unstable; urgency=medium
diff --git a/t/tests/python-new-python2-package-unrel/debian/debian/changelog.in b/t/tests/python-new-python2-package-unrel/debian/debian/changelog.in
new file mode 100644
index 0000000..e50d202
--- /dev/null
+++ b/t/tests/python-new-python2-package-unrel/debian/debian/changelog.in
@@ -0,0 +1,10 @@
+{$source} ({$version}) {$distribution}; urgency=low
+
+  * Lintian Test Suite.
+  * Test: {$testname}
+  * python-{$source} is packaged because...
+
+  * Suppress "should close ITP bug" messages.  (Closes: #123456)
+
+ -- {$author}  {$date}
+
diff --git a/t/tests/python-new-python2-package-unrel/debian/debian/control.in b/t/tests/python-new-python2-package-unrel/debian/debian/control.in
new file mode 100644
index 0000000..b6c1aa9
--- /dev/null
+++ b/t/tests/python-new-python2-package-unrel/debian/debian/control.in
@@ -0,0 +1,27 @@
+Source: {$source}
+Priority: optional
+Section: python
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Rules-Requires-Root: no
+
+Package: python-{$source}
+Architecture: all
+Depends: $\{misc:Depends\}, python2.7
+Description: Python 2 package with no corresponding Python 3 package
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
+
+Package: python3-{$source}
+Architecture: all
+Depends: $\{misc:Depends\}, python3
+Description: Python 2 package with corresponding Python 3 package
+ This is a test package designed to exercise some feature or tag of
+ Lintian.  It is part of the Lintian test suite and may do very odd
+ things.  It should not be installed like a regular package.  It may
+ be an empty package.
+ .
+ Python 3 variant.
diff --git a/t/tests/python-new-python2-package-unrel/desc b/t/tests/python-new-python2-package-unrel/desc
new file mode 100644
index 0000000..e30fc4b
--- /dev/null
+++ b/t/tests/python-new-python2-package-unrel/desc
@@ -0,0 +1,5 @@
+Testname: python-new-python2-package-unrel
+Version: 1.0
+Description: Check various Python 2 issues (false positives)
+Test-Against:
+ new-package-should-not-package-python2-module
diff --git a/t/tests/python-new-python2-package-unrel/tags b/t/tests/python-new-python2-package-unrel/tags
new file mode 100644
index 0000000..e69de29

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


Reply to: