2015-12-10 19:38:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2019-09-25 01:22:08 +00:00
|
|
|
if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 8 ]]; then
|
2019-03-17 09:54:38 +00:00
|
|
|
# RHEL8 has a system python, separate from the user python. What
|
|
|
|
# a good idea, abstracting the python binary for system scripts!
|
|
|
|
# :) Use it for dib-python.
|
|
|
|
python_path=/usr/libexec/platform-python
|
2020-02-05 10:42:52 +00:00
|
|
|
elif [[ ${DISTRO_NAME} =~ (debian) && ${DIB_PYTHON_VERSION} == 3 ]]; then
|
|
|
|
apt-get install -y python3
|
|
|
|
python_path=$(command -v python${DIB_PYTHON_VERSION})
|
2019-03-17 09:54:38 +00:00
|
|
|
else
|
|
|
|
python_path=$(command -v python${DIB_PYTHON_VERSION})
|
|
|
|
fi
|
|
|
|
|
2015-12-10 19:38:53 +00:00
|
|
|
if [ -z "$python_path" ]; then
|
2016-12-07 20:26:43 +00:00
|
|
|
echo "Could not find python${DIB_PYTHON_VERSION} executable."
|
2015-12-10 19:38:53 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-01-21 19:25:33 +00:00
|
|
|
ln -sf $python_path /usr/local/bin/dib-python
|