Skip to content
Snippets Groups Projects
Commit 73b2b24a authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

PKG: need more strict checking python version

parent fbc4a0f7
Branches
Tags
No related merge requests found
...@@ -115,13 +115,22 @@ python_minor_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[1]) ...@@ -115,13 +115,22 @@ python_minor_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[1])
python_patch_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[2])") python_patch_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[2])")
python_version="$python_major_version.$python_minor_version.$python_patch_version" python_version="$python_major_version.$python_minor_version.$python_patch_version"
if [ "$python_major_version" -gt 2 ]; then python_check_failed() {
printf %s\\n "*****Error occured during installation******"
printf %s\\n "OTB python bindings requires python2.6 or python2.7 but current detected python version is $python_version" printf %s\\n "OTB python bindings requires python2.6 or python2.7 but current detected python version is $python_version"
printf %s\\n "If you have python2.6 or Python2.7 installed in your system " printf %s\\n "If you have python2.6 or Python2.7 installed in your system "
printf %s\\n "You should set OTB_PYTHON_EXE and re-run this installation script." printf %s\\n "You should set OTB_PYTHON_EXE and re-run this installation script."
printf %s\\n "eg: OTB_PYTHON_EXE=/path/to/python2.7 ./OTB-X.Y-Linux64.run" printf %s\\n "eg: OTB_PYTHON_EXE=/path/to/python2.7 ./OTB-X.Y-Linux64.run"
exit 0; exit 1;
}
if [ "$python_major_version" -gt 2 ]; then
python_check_failed
fi fi
if [ "$python_minor_version" -lt 5 ]; then
python_check_failed
fi
python_INSTSONAME=$($OTB_PYTHON_EXE -c "import sys; from distutils import sysconfig; print (sysconfig.get_config_var('INSTSONAME'));") python_INSTSONAME=$($OTB_PYTHON_EXE -c "import sys; from distutils import sysconfig; print (sysconfig.get_config_var('INSTSONAME'));")
python_lib_dirs="/usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu" python_lib_dirs="/usr/lib /usr/lib64 /usr/lib/x86_64-linux-gnu"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment