Mailinglist Archive: opensuse-packaging (43 mails)
< Previous | Next > |
[opensuse-packaging] use of sed to fix python2 script interpreter
- From: Sébastien 'sogal' Poher <sogal@xxxxxxxxxx>
- Date: Thu, 22 Mar 2018 10:39:39 +0100
- Message-id: <20180322093939.h2odp3bnc6ffc6zx@volted.net>
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 'python2').
I have fixed it by adding the following:
sed -i 's|/usr/bin/env\ python|/usr/bin/python2|1'
%{buildroot}/%{_bindir}/%{name}
in %install section.
Is it a good way to do it or is there a more recommended way ?
Thank you
[0] https://build.opensuse.org/package/show/utilities/pyrenamer
[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.
--
Sébastien 'sogal' Poher
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx
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 'python2').
I have fixed it by adding the following:
sed -i 's|/usr/bin/env\ python|/usr/bin/python2|1'
%{buildroot}/%{_bindir}/%{name}
in %install section.
Is it a good way to do it or is there a more recommended way ?
Thank you
[0] https://build.opensuse.org/package/show/utilities/pyrenamer
[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.
--
Sébastien 'sogal' Poher
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx
< Previous | Next > |