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