Mailinglist Archive: opensuse-packaging (43 mails)

< Previous Next >
Re: [opensuse-packaging] use of sed to fix python2 script interpreter
On jeudi, 22 mars 2018 10.39:39 h CET Sébastien 'sogal' Poher wrote:
Hi everyone,

I am packaging pyrenamer [0] in order to submit it to Factory.
As it is, I got this warning [1] because of the 'shebang' calling
'/usr/bin/env python' instead of '/usr/bin/python' (which should be
I have fixed it by adding the following:

sed -i 's|/usr/bin/env\ python|/usr/bin/python2|1'

in %install section.

Is it a good way to do it or is there a more recommended way ?

Thank you


[1] full warning is:
pyrenamer.noarch: E: env-script-interpreter (Badness: 9) /usr/bin/pyrenamer
/usr/bin/env python This script uses 'env' as an interpreter. For the rpm
runtime dependency detection to work, the shebang #!/usr/bin/env python
needs to be patched into #!/usr/bin/python otherwise the package
dependency generator merely adds a dependency on /usr/bin/env rather than
the actual interpreter /usr/bin/python. Alternatively, if the file should
not be executed, then ensure that it is not marked as executable or don't
install it in a path that is reserved for executables.

I wonder why you have it in utilities when it's available in pypi I would say
it should goes to devel:languages:python repository even if it's an

Using pypi you will find the 1.1 version certainly better than the older 0.6.0

Bonus there's no env line to fix in it.
And you will be able to build it for python2 and python3


Bruno Friedmann
Ioda-Net Sàrl
Bareos Partner, openSUSE Member, fsfe fellowship
GPG KEY : D5C9B751C4653227
irc: tigerfoot

To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >