6278371eaa
Right now dib-python works by trying to find any python on a system in an order of precedence. A much better way is if we are explicit about the python we intend to be there which will allow us to make better decisions in other elements (such as allowing for package-installs to take into account DIB_PYTHON_VERSION) as well as allow for users to specify a preferred python version. Co-Authored-By: Adam Harwell <flux.adam@gmail.com> Change-Id: Ie609de51cc5fcde701296c9474e315981d9778a2
25 lines
691 B
Plaintext
25 lines
691 B
Plaintext
# Pick which distros we need to force python2
|
|
if [ -z "${DIB_PYTHON_VERSION:-}" ]; then
|
|
if [ "$DISTRO_NAME" == "ubuntu" ]; then
|
|
if [ "$DIB_RELEASE" == "trusty" ]; then
|
|
DIB_PYTHON_VERSION=2
|
|
fi
|
|
elif [ "$DISTRO_NAME" == "debian" ]; then
|
|
DIB_PYTHON_VERSION=2
|
|
elif [ "$DISTRO_NAME" == "fedora" ]; then
|
|
if [ "$DIB_RELEASE" -le 22 ]; then
|
|
DIB_PYTHON_VERSION=2
|
|
fi
|
|
elif [ "$DISTRO_NAME" == "centos" ]; then
|
|
DIB_PYTHON_VERSION=2
|
|
elif [ "$DISTRO_NAME" == "centos7" ]; then
|
|
DIB_PYTHON_VERSION=2
|
|
fi
|
|
fi
|
|
|
|
if [ -z "${DIB_PYTHON_VERSION:-}" ]; then
|
|
DIB_PYTHON_VERSION=3
|
|
fi
|
|
|
|
export DIB_PYTHON_VERSION
|