Re: #!/usr/bin/python2.3 vs #!/usr/bin/env python2.3
John Goerzen writes:
> Hello,
>
> Many Python programs use constructs like #!/usr/bin/env python2.3 to load
> themselves. Many others use #!/usr/bin/python2.3. On most Debian systems,
> these are the same.
>
> The submitter in #189473 claims that #!/usr/bin/env python2.3 is wrong
> because he has his own python2.3 on the path prior to the system's, and it
> doesn't necessarily have requisite libraries for the programs being run.
>
> Any opinions?
I think you should use the /usr/bin prefix to enforce the dependencies
that your package has. After the temp. install in debian/* I use:
: # Replace all '#!' calls to python with $(PY_INTERPRETER)
: # and make them executable
for i in `find debian/foo -type f`; do \
sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \
$$i > $$i.temp; \
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
mv -f $$i.temp $$i; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
fi; \
done
Reply to: