From 66a81cc965ecb31b36feac613e521019dad98c5b Mon Sep 17 00:00:00 2001 From: Saravanan Solaiyappan Date: Thu, 24 Feb 2022 10:26:04 -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: Ic766d8d68b5168e5f1b065d846ca2604d281e5be [ROCm/ROCR-Runtime commit: a496adafaa80b0221356cbe62a74c9a3a81e77bd] --- .../rocr-runtime/runtime/hsa-runtime/DEBIAN/Binary/prerm.in | 2 +- projects/rocr-runtime/runtime/hsa-runtime/RPM/Binary/postun.in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/Binary/prerm.in b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/Binary/prerm.in index b995a3e8ae..cbc66dff39 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/Binary/prerm.in +++ b/projects/rocr-runtime/runtime/hsa-runtime/DEBIAN/Binary/prerm.in @@ -53,7 +53,7 @@ rm_ldconfig() { } case "$1" in - ( remove ) + ( remove | upgrade) rm_ldconfig ;; ( * ) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/RPM/Binary/postun.in b/projects/rocr-runtime/runtime/hsa-runtime/RPM/Binary/postun.in index 744a770d22..4c1f8f5eb2 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/RPM/Binary/postun.in +++ b/projects/rocr-runtime/runtime/hsa-runtime/RPM/Binary/postun.in @@ -41,7 +41,8 @@ ################################################################################ # left-hand 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/hsa-rocr.conf ldconfig fi