there is chance that a distro offer a newer python3 version than the
supported one, so we need to avoid using the latest python3 version by
specifying the supported python3
Signed-off-by: Kefu Chai <kchai@redhat.com>
case "$ID" in
fedora)
if [ "$VERSION_ID" -ge "29" ] ; then
- PYBUILD="3"
+ PYBUILD="3.7"
fi
;;
rhel|centos)
MAJOR_VER=$(echo "$VERSION_ID" | sed -e 's/\..*$//')
if [ "$MAJOR_VER" -ge "8" ] ; then
- PYBUILD="3"
+ PYBUILD="3.6"
fi
;;
opensuse*|suse|sles)
exit 1
fi
-if [ "$PYBUILD" = "3" ] ; then
- ARGS="$ARGS -DWITH_PYTHON2=OFF -DWITH_PYTHON3=ON -DMGR_PYTHON_VERSION=3"
+if [[ "$PYBUILD" =~ ^3(\..*)?$ ]] ; then
+ ARGS="$ARGS -DWITH_PYTHON2=OFF -DWITH_PYTHON3=${PYBUILD} -DMGR_PYTHON_VERSION=${PYBUILD}"
fi
if type ccache > /dev/null 2>&1 ; then