diskimage-builder/elements/dib-python/pre-install.d/01-dib-python
Gregory Haynes 3afbeeaf4e Add dib-python element
Creating an element which we can use in #! lines to refer to either
python2 or python3 depending on what it available.

Change-Id: Ic47e18ad21c33ab9f0d11c04260a33725aeee814
2015-12-10 19:39:38 +00:00

18 lines
326 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
which which || install-packages which
python_path=$(which python2 || which python3)
if [ -z "$python_path" ]; then
echo "Could not find python2 or python3 executable."
exit 1
fi
ln -s $python_path /usr/local/bin/dib-python