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
|
|
|
|
if [ "$DISTRO_NAME" == "ubuntu" ]; then
|
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
|
|
|
|
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
|
2016-12-19 07:26:42 +00:00
|
|
|
elif [ "$DISTRO_NAME" == "rhel7" ]; then
|
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
|
2019-03-17 09:54:38 +00:00
|
|
|
elif [ "$DISTRO_NAME" == "rhel" ]; then
|
|
|
|
if [ "$DIB_RELEASE" -le 7 ]; then
|
|
|
|
DIB_PYTHON_VERSION=2
|
|
|
|
elif [ "$DIB_RELEASE" -ge 8 ]; then
|
|
|
|
DIB_PYTHON_VERSION=3
|
|
|
|
fi
|
2016-12-14 09:38:22 +00:00
|
|
|
elif [ "$DISTRO_NAME" == "opensuse" ]; then
|
2019-05-20 14:31:41 +00:00
|
|
|
if [ "${DIB_RELEASE:0:2}" == "42" ]; then
|
|
|
|
DIB_PYTHON_VERSION=2
|
|
|
|
fi
|
2016-12-07 20:26:43 +00:00
|
|
|
fi
|
|
|
|
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:
|