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
|
2020-06-09 11:14:28 +02:00
|
|
|
case "$DISTRO_NAME" in
|
|
|
|
ubuntu)
|
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
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
debian)
|
2016-12-07 12:26:43 -08:00
|
|
|
DIB_PYTHON_VERSION=2
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
fedora)
|
2016-12-07 12:26:43 -08:00
|
|
|
if [ "$DIB_RELEASE" -le 22 ]; then
|
|
|
|
DIB_PYTHON_VERSION=2
|
|
|
|
fi
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
centos7)
|
2016-12-07 12:26:43 -08:00
|
|
|
DIB_PYTHON_VERSION=2
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
rhel7)
|
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
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
rhel|centos)
|
|
|
|
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
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
opensuse)
|
2019-05-20 16:31:41 +02:00
|
|
|
if [ "${DIB_RELEASE:0:2}" == "42" ]; then
|
|
|
|
DIB_PYTHON_VERSION=2
|
|
|
|
fi
|
2020-06-09 11:14:28 +02:00
|
|
|
;;
|
|
|
|
esac
|
2016-12-07 12:26:43 -08:00
|
|
|
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:
|