om屏蔽python差异

This commit is contained in:
jianghongbo
2023-02-26 15:15:59 +08:00
parent f5f26bf151
commit 356e88ee0e
4 changed files with 5 additions and 20 deletions

View File

@ -81,19 +81,11 @@ declare package_name="${package_pre_name}.tar.gz"
declare sha256_name="${package_pre_name}.sha256" declare sha256_name="${package_pre_name}.sha256"
if [ ${binarylib_dir} != 'None' ] && [ -d ${binarylib_dir} ]; then if [ ${binarylib_dir} != 'None' ] && [ -d ${binarylib_dir} ]; then
if [[ $(python -V | awk '{print $2}') =~ "3.9" ]]; then BINARYLIBS_PATH_INSTALL_TOOLS="${binarylib_dir}/install_tools"
BINARYLIBS_PATH_INSTALL_TOOLS="${binarylib_dir}/install_tools_python39"
else
BINARYLIBS_PATH_INSTALL_TOOLS="${binarylib_dir}/install_tools"
fi
BINARYLIBS_PATH="${binarylib_dir}/kernel/dependency/" BINARYLIBS_PATH="${binarylib_dir}/kernel/dependency/"
BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/" BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/"
else else
if [[ $(python -V | awk '{print $2}') =~ "3.9" ]]; then BINARYLIBS_PATH_INSTALL_TOOLS="${ROOT_DIR}/install_tools"
BINARYLIBS_PATH_INSTALL_TOOLS="${ROOT_DIR}/install_tools_python39"
else
BINARYLIBS_PATH_INSTALL_TOOLS="${ROOT_DIR}/install_tools"
fi
BINARYLIBS_PATH="${ROOT_DIR}/binarylibs/kernel/dependency/" BINARYLIBS_PATH="${ROOT_DIR}/binarylibs/kernel/dependency/"
BUILD_TOOLS_PATH="${ROOT_DIR}/binarylibs/buildtools/" BUILD_TOOLS_PATH="${ROOT_DIR}/binarylibs/buildtools/"
fi fi
@ -201,6 +193,7 @@ function lib_copy()
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/six.py ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/six.py ${PKG_TMP_DIR}/lib
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend.py ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend.py ${PKG_TMP_DIR}/lib
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend.so* ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend.so* ${PKG_TMP_DIR}/lib
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend_* ${PKG_TMP_DIR}/lib
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/paramiko ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/paramiko ${PKG_TMP_DIR}/lib
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/psutil ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/psutil ${PKG_TMP_DIR}/lib
cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/netifaces ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/netifaces ${PKG_TMP_DIR}/lib

View File

@ -41,7 +41,7 @@ try:
import psutil import psutil
except ImportError as e: except ImportError as e:
# mv psutil mode .so file by python version # mv psutil mode .so file by python version
pythonVer = sys.version[:3] pythonVer = str(sys.version_info[0]) + '.' + str(sys.version_info[1])
psutilLinux = os.path.join(localDirPath, psutilLinux = os.path.join(localDirPath,
"./../../../lib/psutil/_psutil_linux.so") "./../../../lib/psutil/_psutil_linux.so")
psutilPosix = os.path.join(localDirPath, psutilPosix = os.path.join(localDirPath,

View File

@ -28,14 +28,6 @@ def checkPythonVersion():
raise Exception("[GAUSS-52200] : version of python" raise Exception("[GAUSS-52200] : version of python"
" is not correct: %s." % " is not correct: %s." %
distName + " should use Python 3.*") distName + " should use Python 3.*")
if re.search("oe1", distName) is not None:
if not pythonVersion == (3, 7):
print("Warnging version of python doesnot meet the expection, maybe third-party libs "
"need to be compiled by yourself")
else:
if not pythonVersion == (3, 6):
print("Warnging version of python doesnot meet the expection, maybe third-party libs "
"need to be compiled by yourself")
return True return True
def check_python_compiler_option(): def check_python_compiler_option():

View File

@ -64,7 +64,7 @@ try:
import psutil import psutil
except ImportError as e: except ImportError as e:
# mv psutil mode .so file by python version # mv psutil mode .so file by python version
pythonVer = sys.version[:3] pythonVer = str(sys.version_info[0]) + '.' + str(sys.version_info[1])
psutilLinux = os.path.join(localDirPath, psutilLinux = os.path.join(localDirPath,
"./../../../lib/psutil/_psutil_linux.so") "./../../../lib/psutil/_psutil_linux.so")
psutilPosix = os.path.join(localDirPath, psutilPosix = os.path.join(localDirPath,