From 2325ccba3084d08c4f894f237adacd537b79ab17 Mon Sep 17 00:00:00 2001 From: Saravanan Solaiyappan Date: Thu, 24 Feb 2022 12:01:39 -0500 Subject: [PATCH] Consider apt/yum upgrade operation check in package scripts. Include the upgrade operation check in the prerm and postun scripts in package. Signed-off-by: Saravanan Solaiyappan Change-Id: Ib95ea72f15bfbf4141b69b0a8ca4d3a71fe1c093 [ROCm/ROCR-Runtime commit: 046f2e91165d2d478d944ffa54b2530015541857] --- projects/rocr-runtime/DEBIAN/prerm.in | 2 +- projects/rocr-runtime/RPM/postun.in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/DEBIAN/prerm.in b/projects/rocr-runtime/DEBIAN/prerm.in index 5cc004f399..f16a1ab3b7 100755 --- a/projects/rocr-runtime/DEBIAN/prerm.in +++ b/projects/rocr-runtime/DEBIAN/prerm.in @@ -10,7 +10,7 @@ rm_ldconfig() { } case "$1" in - ( remove ) + ( remove | upgrade ) rm_ldconfig ;; ( purge ) diff --git a/projects/rocr-runtime/RPM/postun.in b/projects/rocr-runtime/RPM/postun.in index 8e8eb1fea4..0691ac8617 100644 --- a/projects/rocr-runtime/RPM/postun.in +++ b/projects/rocr-runtime/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-libhsakmt.conf ldconfig fi