Re: simple trick to make dealing with python 2/3 scripts easier

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



In case anyone's still interested in this, I found a pacman.conf option 
called NoExtract, which lets you tell pacman not to overwrite certain files 
and directories in the filesystem. So you could add the following line to 
/etc/pacman.conf:

NoExtract = /usr/bin/python

which would prevent pacman from overwriting the custom /usr/bin/python 
script. Here is the most recent version of the /usr/bin/python script:

#!/usr/bin/env bash
test "$PYTHON" != "python2" -a "$PYTHON" != "python3" && unset PYTHON
exec /usr/bin/"${PYTHON:-python3}" "$@"

This version does some input checking to make sure the only valid options 
for the PYTHON environment variable are "python2" or "python3".

Ben



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux