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

Bug#743599: lintian: false positive python-script-but-no-python-dep when using #!/usr/bin/python2



Control: tags -1 patch

On Fri, 04 Apr 2014 03:31:05 +0200 Per Andersson <avtobiff@gmail.com> wrote:
> Package: lintian
> Version: 2.5.22.1
> Severity: normal
> 
> Dear Maintainer,
> 
> Including a script with shebang #!/usr/bin/python2 in a Debian package
> results in lintian reporting the error python-script-but-no-python-dep.
> 
> I believe this to be incorrect since python-minimal ships
> /usr/bin/python2 as a symlink to python2.7, as per upstream PEP0394 [1].
> 
> 
> [1] http://legacy.python.org/dev/peps/pep-0394/

Dear Maintainer(s),

A new script was recently added to the Linux kernel in version 4.3:
https://github.com/torvalds/linux/commit/4b715d24f4f14731c7b553cbb8604fe865cb8d3c
This script uses /usr/bin/python2 as shebang as indicated by pep0394,
since it depends strictly on Python 2.

This Lintian bug is causing it to be flagged as an error in our internal
build of the kernel, so it got on our radar. The attached patch fixes
the problem by having /usr/bin/python2 treated as /usr/bin/python. Would
this be an acceptable solution to the problem? If not, what would you
recommend?

Thank you!

Kind regards,
Luca Boccassi
Brocade Communications Systems


From c9a9e433c7734737712f1fc1067bdf6966938ec1 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi@gmail.com>
Date: Fri, 8 Jan 2016 20:12:09 +0000
Subject: [PATCH] Do not match /usr/bin/python2 to python2:any

A python2 package does not exist, so dh_python correctly does not
generate a dependency.
Using /usr/bin/python2 as shebang is required as explained in pep-0394:
http://legacy.python.org/dev/peps/pep-0394/
---
 data/scripts/versioned-interpreters | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/scripts/versioned-interpreters b/data/scripts/versioned-interpreters
index fff44c2..48b8cc5 100644
--- a/data/scripts/versioned-interpreters
+++ b/data/scripts/versioned-interpreters
@@ -75,7 +75,7 @@ lua     => /usr/bin, lua([\d.]+), lua$1, 40 50 5.1 5.2
 octave  => /usr/bin, octave([\d.]+), octave$1, 3.0 3.2
 php     => /usr/bin, php(\d+), php$1-cli, 5, @NO_DEFAULT_DEPS@
 pike    => /usr/bin, pike([\d.]+), pike$1 | pike$1-core, 7.6 7.8, @NO_DEFAULT_DEPS@
-python  => /usr/bin, python([\d.]+), python$1:any | python$1-minimal:any, 2.7, @SKIP_UNVERSIONED@
+python  => /usr/bin, python(2\..+|[3-9.]+), python$1:any | python$1-minimal:any, 2.7, @SKIP_UNVERSIONED@
 ruby    => /usr/bin, ruby([\d.]+), ruby$1, 1.8 1.9, @SKIP_UNVERSIONED@
 runghc  => /usr/bin, runghc(\d+), ghc$1, 6, ghc
 scsh    => /usr/bin, scsh-([\d.]+), scsh-$1, 0.6
-- 
2.1.4

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: