]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
do_cmake.sh: specify the supported py versions for different distros 29148/head
authorKefu Chai <kchai@redhat.com>
Tue, 23 Jul 2019 16:43:03 +0000 (00:43 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 23 Jul 2019 16:45:22 +0000 (00:45 +0800)
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>
do_cmake.sh

index 8a9a39b8cea0b6ab3a1bcc3c8af3f0b5964bb045..2e1593ec2fc85ad02f963754a67b018f5b5e1781 100755 (executable)
@@ -12,13 +12,13 @@ if [ -r /etc/os-release ]; then
   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)
@@ -34,8 +34,8 @@ else
   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