* Brian May <br...@microcomaustralia.com.au>, 2014-07-20, 11:47:
Or, another words, ideally we want all these to work:

python2 /usr/bin/django-admin - python2
python3 /usr/bin/django-admin - python3
/usr/bin/django-admin - autodetect.

One possibility is to write a shell script that is also valid Python code. PoC:

#!/bin/sh
sh=''''
if command -v python3 > /dev/null; then
        exec python3 "$0" "$@"
else
        exec python "$0" "$@"
fi
' '''
import sys
print("I'm Python %d.%d!" % sys.version_info[:2])


Another possibility is to create the django-admin symlink in maintainer scripts, with the target depending on which of python*-django packages are installer. This is how src:sphinx manages its /usr/bin/sphinx-* symlinks.

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140720090004.ga2...@jwilk.net

Reply via email to