Allow python3 to be used in Debian

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
This commit is contained in:
Riccardo Pittau 2020-02-05 11:42:52 +01:00
parent 500e60dbf4
commit cf7d39e4cd

View File

@ -11,6 +11,9 @@ if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 8 ]]; then
# 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