diff --git a/DEBIAN/postinst.in b/DEBIAN/postinst.in index a4969efc46..c168fa4d75 100755 --- a/DEBIAN/postinst.in +++ b/DEBIAN/postinst.in @@ -106,7 +106,8 @@ do_ldconfig() { do_install_amdsmi_python_lib() { # get python version - local python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') + local python3_minor_version + python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') if [ $? -ne 0 ]; then echo "[WARNING] Could not determine python version. "\ "AMD-SMI python library will not be installed." @@ -135,7 +136,7 @@ do_install_amdsmi_python_lib() { case "$1" in ( configure ) - do_install_amdsmi_python_lib + do_install_amdsmi_python_lib || return 0 do_ldconfig do_configureLogrotate || return 0 ;; diff --git a/DEBIAN/prerm.in b/DEBIAN/prerm.in index 6ec49763f3..186593ce2e 100755 --- a/DEBIAN/prerm.in +++ b/DEBIAN/prerm.in @@ -35,7 +35,8 @@ return_logrotateToOrigConfig() { rm_python_lib() { # get python version - local python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') + local python3_minor_version + python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') if [ $? -ne 0 ]; then echo "[WARNING] Could not determine python version. "\ "AMD-SMI python library will not be uninstalled." @@ -44,7 +45,7 @@ rm_python_lib() { # check if python version is supported if [ "$python3_minor_version" -lt 6 ]; then - echo "[INFO] AMD-SMI python library is not supported on python version 3.$python3_minor_version. "\ + echo "[WARNING] AMD-SMI python library is not supported on python version 3.$python3_minor_version. "\ "AMD-SMI python library will not be uninstalled." return fi @@ -62,7 +63,7 @@ case "$1" in ( remove | upgrade) # remove old gpuv-smi symlink rm -f @CPACK_PACKAGING_INSTALL_PREFIX@/bin/gpuv-smi &> /dev/null - rm_python_lib + rm_python_lib || return 0 rm_ldconfig rm_pyc rm_logFolder diff --git a/RPM/post.in b/RPM/post.in index 47dedb1baf..cf760e9d07 100755 --- a/RPM/post.in +++ b/RPM/post.in @@ -106,7 +106,8 @@ do_ldconfig() { do_install_amdsmi_python_lib() { # get python version - local python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') + local python3_minor_version + python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') if [ $? -ne 0 ]; then echo "[WARNING] Could not determine python version. "\ "AMD-SMI python library will not be installed." @@ -135,7 +136,7 @@ do_install_amdsmi_python_lib() { # post install or upgrade, $i is 1 or 2 -> do these actions if [ "$1" -ge 1 ]; then - do_install_amdsmi_python_lib + do_install_amdsmi_python_lib || return 0 do_ldconfig do_configureLogrotate || return 0 fi diff --git a/RPM/preun.in b/RPM/preun.in index 85333f7984..00bd4d374c 100755 --- a/RPM/preun.in +++ b/RPM/preun.in @@ -27,7 +27,8 @@ return_logrotateToOrigConfig() { rm_python_lib() { # get python version - local python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') + local python3_minor_version + python3_minor_version=$(python3 -c 'import sys;print(sys.version_info.minor)') if [ $? -ne 0 ]; then echo "[WARNING] Could not determine python version. "\ "AMD-SMI python library will not be uninstalled." @@ -36,7 +37,7 @@ rm_python_lib() { # check if python version is supported if [ "$python3_minor_version" -lt 6 ]; then - echo "[INFO] AMD-SMI python library is not supported on python version 3.$python3_minor_version. "\ + echo "[WARNING] AMD-SMI python library is not supported on python version 3.$python3_minor_version. "\ "AMD-SMI python library will not be uninstalled." return fi @@ -54,7 +55,7 @@ if [ "$1" -le 1 ]; then # perform the below actions for rpm remove($1=0) or upgrade($1=1) operations # remove old gpuv-smi symlink rm -f @CPACK_PACKAGING_INSTALL_PREFIX@/bin/gpuv-smi &> /dev/null - rm_python_lib + rm_python_lib || return 0 rm_pyc rm_logFolder return_logrotateToOrigConfig