cf7d39e4cd
Debian default Python interpreter version is 2.7, but it's possible to install a Python 3 interpreter from the base repository. With this change, if we set DIB_PYTHON_VERSION to 3, we install the python3 package from base, with python3-libs, python3-pip and python3-setuptools, and redefine python_path, effectively allowing Python 3 interpreter to be used in Debian. See a result of the job for building the ipa image here: https://review.opendev.org/705773 Change-Id: Idabfa94c2bff6e0de6daa0866084d5db14d7dcb0
26 lines
768 B
Bash
Executable file
26 lines
768 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 8 ]]; then
|
|
# 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
|
|
elif [[ ${DISTRO_NAME} =~ (debian) && ${DIB_PYTHON_VERSION} == 3 ]]; then
|
|
apt-get install -y python3
|
|
python_path=$(command -v python${DIB_PYTHON_VERSION})
|
|
else
|
|
python_path=$(command -v python${DIB_PYTHON_VERSION})
|
|
fi
|
|
|
|
if [ -z "$python_path" ]; then
|
|
echo "Could not find python${DIB_PYTHON_VERSION} executable."
|
|
exit 1
|
|
fi
|
|
|
|
ln -sf $python_path /usr/local/bin/dib-python
|