2019-03-17 11:54:38 +02:00
|
|
|
# Pick which distros we need to force python2 and which to python3
|
2016-12-07 12:26:43 -08:00
|
|
|
if [ -z "${DIB_PYTHON_VERSION:-}" ]; then
|
|
|
|
if [ "$DISTRO_NAME" == "ubuntu" ]; then
|
2017-05-26 00:25:26 +02:00
|
|
|
if [ "$DIB_RELEASE" == "trusty" ]; then
|
2016-12-07 12:26:43 -08:00
|
|
|
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" == "centos7" ]; then
|
|
|
|
DIB_PYTHON_VERSION=2
|
2016-12-19 09:26:42 +02:00
|
|
|
elif [ "$DISTRO_NAME" == "rhel7" ]; then
|
2019-03-17 11:54:38 +02:00
|
|
|
# TODO(nmagnezi): Remove this when the 'rhel7' element gets replaced by 'rhel'
|
2016-12-19 09:26:42 +02:00
|
|
|
DIB_PYTHON_VERSION=2
|
2019-09-25 01:22:08 +00:00
|
|
|
elif [[ "$DISTRO_NAME" =~ (rhel|centos) ]]; then
|
2020-02-19 10:37:26 +01:00
|
|
|
if [[ "${DIB_RELEASE}" == "7" ]]; then
|
2019-03-17 11:54:38 +02:00
|
|
|
DIB_PYTHON_VERSION=2
|
2020-02-19 10:37:26 +01:00
|
|
|
else
|
2019-03-17 11:54:38 +02:00
|
|
|
DIB_PYTHON_VERSION=3
|
|
|
|
fi
|
2016-12-14 09:38:22 +00:00
|
|
|
elif [ "$DISTRO_NAME" == "opensuse" ]; then
|
2019-05-20 16:31:41 +02:00
|
|
|
if [ "${DIB_RELEASE:0:2}" == "42" ]; then
|
|
|
|
DIB_PYTHON_VERSION=2
|
|
|
|
fi
|
2016-12-07 12:26:43 -08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${DIB_PYTHON_VERSION:-}" ]; then
|
|
|
|
DIB_PYTHON_VERSION=3
|
|
|
|
fi
|
|
|
|
|
|
|
|
export DIB_PYTHON_VERSION
|
2017-04-11 10:38:22 +10:00
|
|
|
export DIB_PYTHON=python${DIB_PYTHON_VERSION}
|
|
|
|
|
|
|
|
# Local variables:
|
|
|
|
# mode: sh
|
|
|
|
# End:
|