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

[lintian] 05/06: Import "python-version: current" check from lintian4py



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

nthykier pushed a commit to branch master
in repository lintian.

commit eb4c33e57dd1dd449bf588bd8004599bb8a9c595
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Feb 22 17:43:31 2015 +0100

    Import "python-version: current" check from lintian4py
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/fields.desc                                           | 7 +++++++
 checks/fields.pm                                             | 5 +++++
 debian/changelog                                             | 2 ++
 t/tests/fields-malformed-py-version/debian/debian/control.in | 2 +-
 t/tests/fields-malformed-py-version/desc                     | 4 +++-
 t/tests/fields-malformed-py-version/tags                     | 3 ++-
 6 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/checks/fields.desc b/checks/fields.desc
index 59ff571..0ceea58 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1239,3 +1239,10 @@ Info: Package should not suggest or recommend libservlet-java
  .
  If there is otherwise a valid reason for this suggestion or recommendation,
  please override the tag.
+
+# Imported from lintian4python (python/helpers)
+Tag: python-version-current-is-deprecated
+Severity: normal
+Certainty: certain
+Info: The use of "current" in the Python-Version field is deprecated.
+Ref: python-policy 3.4
diff --git a/checks/fields.pm b/checks/fields.pm
index 0a59f30..dd58d12 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -1209,6 +1209,11 @@ sub run {
             ['all']);
 
         my @pyversion = split(/\s*,\s*/, $pyversion);
+
+        if ($pyversion =~ m/^current/) {
+            tag 'python-version-current-is-deprecated';
+        }
+
         if (@pyversion > 2) {
             if (any { !/^\d+\.\d+$/ } @pyversion) {
                 tag 'malformed-python-version', $pyversion;
diff --git a/debian/changelog b/debian/changelog
index e372a99..a762f45 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,8 @@ lintian (2.5.31) UNRELEASED; urgency=medium
     + [BR] Add reference to build-depends-on-metapackage
       (Closes: #767107).
     + [BR] Check source version (Closes: #749103).
+    + [NT] Import check of "Python-version: current" being
+      deprecated from lintian4python.
   * checks/files.{desc,pm}:
     + [BR] Rename compressed-objects.inv to
       file-should-not-be-compressed and use it for doxygen
diff --git a/t/tests/fields-malformed-py-version/debian/debian/control.in b/t/tests/fields-malformed-py-version/debian/debian/control.in
index 56d411a..7203fea 100644
--- a/t/tests/fields-malformed-py-version/debian/debian/control.in
+++ b/t/tests/fields-malformed-py-version/debian/debian/control.in
@@ -3,7 +3,7 @@ Priority: extra
 Section: java
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-XS-Python-Version: 2.5 2.6
+XS-Python-Version: current 2.6
 Build-Depends: debhelper (>= 9)
 
 Package: {$source}
diff --git a/t/tests/fields-malformed-py-version/desc b/t/tests/fields-malformed-py-version/desc
index 7a7b50d..cd82463 100644
--- a/t/tests/fields-malformed-py-version/desc
+++ b/t/tests/fields-malformed-py-version/desc
@@ -2,4 +2,6 @@ Testname: fields-malformed-py-version
 Sequence: 6000
 Version: 1.0
 Description: Test for malformed python-version field
-Test-For: malformed-python-version
+Test-For:
+ malformed-python-version
+ python-version-current-is-deprecated
diff --git a/t/tests/fields-malformed-py-version/tags b/t/tests/fields-malformed-py-version/tags
index 4ff63ac..72a0600 100644
--- a/t/tests/fields-malformed-py-version/tags
+++ b/t/tests/fields-malformed-py-version/tags
@@ -1 +1,2 @@
-E: fields-malformed-py-version source: malformed-python-version 2.5 2.6
+E: fields-malformed-py-version source: malformed-python-version current 2.6
+W: fields-malformed-py-version source: python-version-current-is-deprecated

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


Reply to: