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

[lintian] 01/01: Add new-package-should-not-package-python2-module tag



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

nthykier pushed a commit to branch master
in repository lintian.

commit 41bad2dbac463118e826f1d7a6183f6ec5d6c558
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Jul 5 20:14:00 2016 +0200

    Add new-package-should-not-package-python2-module tag
    
    The 2.x series of Python is due for deprecation and will not be
    maintained past 2020 so it is recommended that Python 2 modules are
    not packaged unless necessary.
    
    Signed-off-by: Chris Lamb <lamby@debian.org>
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/scripts.desc                              | 15 ++++++++++++++-
 checks/scripts.pm                                |  7 +++++++
 debian/changelog                                 |  3 +++
 t/tests/scripts-python2/debian/debian/control.in | 15 +++++++++++++++
 t/tests/scripts-python2/desc                     |  8 ++++++++
 t/tests/scripts-python2/tags                     |  1 +
 6 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/checks/scripts.desc b/checks/scripts.desc
index db34239..c980688 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -3,7 +3,7 @@ Author: Richard Braakman <dark@xs4all.nl>
 Abbrev: scr
 Type: binary
 Info: This script checks the #! lines of scripts in a package.
-Needs-Info: unpacked, file-info, scripts, bin-pkg-control
+Needs-Info: unpacked, file-info, changelog-file, scripts, bin-pkg-control
 
 Tag: script-without-interpreter
 Severity: important
@@ -751,3 +751,16 @@ Severity: classification
 Certainty: possible
 Info: The maintainer scripts of the package one or more auto-generated
  shell snippets inserted by the listed debhelper tool.
+
+Tag: new-package-should-not-package-python2-module
+Severity: wishlist
+Certainty: certain
+Info: This package appears to be the first packaging of a new upstream
+ software package but it appears to package a module for Python 2.
+ .
+ The 2.x series of Python is due for deprecation and will not be maintained
+ past 2020 so it is recommended that Python 2 modules are not packaged unless
+ necessary.
+ .
+ This warning can be ignored if the package is not intended for Debian or
+ if it is a split of an existing Debian package.
diff --git a/checks/scripts.pm b/checks/scripts.pm
index f7c3705..1228291 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -1109,6 +1109,13 @@ sub run {
         }
     }
 
+    my @entries = $info->changelog->data;
+
+    if (@entries == 1) {
+      tag 'new-package-should-not-package-python2-module', $pkg
+        if $pkg =~ /^python-/
+    }
+
     return;
 }
 
diff --git a/debian/changelog b/debian/changelog
index 8838d54..56a27e2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,6 +35,9 @@ lintian (2.5.50) UNRELEASED; urgency=medium
       test for php scripts without a php-cli dependency.  Thanks
       to Ondřej Surý for the report and Mathieu Parent for the
       initial patch.  (Closes: #818962)
+    + [CL, NT] Warn about new source packages providing a python2
+      package as EOL for python2 is expected in 2020, which is
+      before buster's expected EOL.  (Closes: #829744)
 
   * collection/objdump-info.desc:
     + [NT] Bump version due to RUNPATH collection.
diff --git a/t/tests/scripts-python2/debian/debian/control.in b/t/tests/scripts-python2/debian/debian/control.in
new file mode 100644
index 0000000..993dee7
--- /dev/null
+++ b/t/tests/scripts-python2/debian/debian/control.in
@@ -0,0 +1,15 @@
+Source: {$source}
+Priority: extra
+Section: python
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 9)
+
+Package: python-{$source}
+Architecture: all
+Depends: $\{misc:Depends\}, python2.7
+Description: {$description}
+ 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.
diff --git a/t/tests/scripts-python2/desc b/t/tests/scripts-python2/desc
new file mode 100644
index 0000000..56dba16
--- /dev/null
+++ b/t/tests/scripts-python2/desc
@@ -0,0 +1,8 @@
+Testname: scripts-python2
+Sequence: 6000
+Version: 1.0
+Description: Check various Python 2 issues
+Skeleton: pedantic
+Options: --pedantic -I -E
+Test-For:
+ new-package-should-not-package-python2-module
diff --git a/t/tests/scripts-python2/tags b/t/tests/scripts-python2/tags
new file mode 100644
index 0000000..685f534
--- /dev/null
+++ b/t/tests/scripts-python2/tags
@@ -0,0 +1 @@
+I: python-scripts-python2: new-package-should-not-package-python2-module python-scripts-python2

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


Reply to: