From 913986f72124151c8660acbbd17073bf7e0e5ece Mon Sep 17 00:00:00 2001 From: Saravanan Solaiyappan Date: Thu, 24 Feb 2022 09:59:02 -0500 Subject: [PATCH] Consider apt/yum upgrade operation check in package scripts. Include the upgrade operation check in the prerm and postun scripts for rocm-smi-lib package. Signed-off-by: Saravanan Solaiyappan Change-Id: Ic3dee7ae50a2ac317f1aab88472b6d4805c4de90 [ROCm/rocm_smi_lib commit: 3a3b8dd25d0acf3f61b41bbb570ead8f89b553f6] --- projects/rocm-smi-lib/DEBIAN/prerm.in | 2 +- projects/rocm-smi-lib/RPM/postun.in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/rocm-smi-lib/DEBIAN/prerm.in b/projects/rocm-smi-lib/DEBIAN/prerm.in index 09404a612b..b7bc04b85d 100755 --- a/projects/rocm-smi-lib/DEBIAN/prerm.in +++ b/projects/rocm-smi-lib/DEBIAN/prerm.in @@ -11,7 +11,7 @@ rm_ldconfig() { } case "$1" in - ( remove ) + ( remove | upgrade) rm_ldconfig ;; ( purge ) diff --git a/projects/rocm-smi-lib/RPM/postun.in b/projects/rocm-smi-lib/RPM/postun.in index 05c2a309ab..d54cd9b2ea 100755 --- a/projects/rocm-smi-lib/RPM/postun.in +++ b/projects/rocm-smi-lib/RPM/postun.in @@ -1,5 +1,6 @@ # second term originates from ENABLE_LDCONFIG = ON/OFF at package build -if [ $1 -eq 0 ] && [ "@ENABLE_LDCONFIG@" == "ON" ]; then +if [ $1 -le 1 ] && [ "@ENABLE_LDCONFIG@" == "ON" ]; then + # perform the below actions for rpm remove($1=0) or upgrade($1=1) operations rm -f /etc/ld.so.conf.d/x86_64-librocm_smi_lib.conf ldconfig fi