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

[lintian] 01/03: data/scripts/interpreter: fix false positive with python2 as interpreter



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

nthykier pushed a commit to branch master
in repository lintian.

commit 765da083a9d88e3b0d33ad5ce3ad6b3d81529b1e
Author: Antonio Ospite <ao2@ao2.it>
Date:   Mon Nov 7 16:55:26 2016 +0100

    data/scripts/interpreter: fix false positive with python2 as interpreter
    
    When using dh_python2 the package ends up depending on python:any
    (Debian does not have a python2:any package).
    
    However if a script uses python2 as the interpreter, the lintian
    dependency checks fails:
    
      E: scripts: python-script-but-no-python-dep usr/bin/script_name
    
    Basically lintian tries to look for a dependency on python2:any, it does
    not know that python:any is OK as a dependency for scripts using python2
    in the shebang line.
    
    This can be verified by temporarily adding "python:any" to
    t/tests/legacy-scripts/debian/debian/control and running the test:
    
      debian/rules runtests onlyrun=legacy-scripts
    
    Lintian will not give the error anymore for pyfoo, but it will still
    emit it for py2foo which is wrong.
    
    Fix the issue adding python2 to the unversioned interpreters, the
    rationale being that the python2 interpreter requires unversioned
    dependencies.
    
    After the fix, lintian will give a clearer error when the dependency is
    really missing:
    
      E: scripts: missing-dep-for-interpreter python2 => python:any | python-minimal:any (usr/bin/py2foo)
    
    And to prove that the false positive is not occurring anymore,
    temporarily adding "python:any" to
    t/tests/legacy-scripts/debian/debian/control will not give the error
    anymore for py2foo either when running:
    
      debian/rules runtests onlyrun=legacy-scripts
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 data/scripts/interpreters   | 1 +
 t/tests/legacy-scripts/tags | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/data/scripts/interpreters b/data/scripts/interpreters
index 81100d2..3f5e2d5 100644
--- a/data/scripts/interpreters
+++ b/data/scripts/interpreters
@@ -73,6 +73,7 @@ plackup        => /usr/bin, libplack-perl
 procmail       => /usr/bin
 pypy           => /usr/bin
 python         => /usr/bin, python:any | python-minimal:any
+python2        => /usr/bin, python:any | python-minimal:any
 pforth         => /usr/bin
 racket         => /usr/bin
 rake           => /usr/bin
diff --git a/t/tests/legacy-scripts/tags b/t/tests/legacy-scripts/tags
index 58d6d62..913844d 100644
--- a/t/tests/legacy-scripts/tags
+++ b/t/tests/legacy-scripts/tags
@@ -13,13 +13,13 @@ E: scripts: init.d-script-has-unterminated-lsb-section etc/init.d/lsb-broken:15
 E: scripts: init.d-script-needs-depends-on-lsb-base etc/init.d/skeleton (line 40)
 E: scripts: missing-dep-for-interpreter jruby => jruby | jruby1.0 | jruby1.1 | jruby1.2 (usr/bin/jruby-broken)
 E: scripts: missing-dep-for-interpreter lefty => graphviz (usr/bin/lefty-foo)
+E: scripts: missing-dep-for-interpreter python2 => python:any | python-minimal:any (usr/bin/py2foo)
 E: scripts: package-installs-python-bytecode usr/lib/python2.3/site-packages/test.pyc
 E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/php7.0envfoo
 E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/php7.0foo
 E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/phpenvfoo
 E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/phpfoo
 E: scripts: python-script-but-no-python-dep usr/bin/py2.Xfoo
-E: scripts: python-script-but-no-python-dep usr/bin/py2foo
 E: scripts: python-script-but-no-python-dep usr/bin/pyfoo
 E: scripts: shell-script-fails-syntax-check usr/bin/sh-broken
 E: scripts: wrong-path-for-interpreter usr/bin/lefty-foo (#!/usr/local/bin/lefty != /usr/bin/lefty)

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


Reply to: