From 92e972eae354b55f4962165ac82b8b2e923d2b35 Mon Sep 17 00:00:00 2001 From: Ashutosh Misra Date: Fri, 12 Nov 2021 22:01:41 +0530 Subject: [PATCH] SWDEV-264665 - resolve uninstall breakage Check required of existence of dir in the prerm Change-Id: I54e1bc0309e82794b41fcc2ae1f01f004138dcee [ROCm/clr commit: 0f79d51998b06e0537407d3b71c7a6e43c00ec29] --- projects/clr/opencl/packaging/rocm-opencl.prerm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/clr/opencl/packaging/rocm-opencl.prerm b/projects/clr/opencl/packaging/rocm-opencl.prerm index 722d3e1aa4..927973f727 100644 --- a/projects/clr/opencl/packaging/rocm-opencl.prerm +++ b/projects/clr/opencl/packaging/rocm-opencl.prerm @@ -14,8 +14,12 @@ case "$1" in rm -f @ROCM_PATH@/lib/libOpenCL.so rm -f @ROCM_PATH@/lib/libOpenCL.so.@OPENCL_LIB_VERSION_MAJOR@ rm -f @ROCM_PATH@/lib/libOpenCL.so.@OPENCL_LIB_VERSION_STRING@ - rmdir --ignore-fail-on-non-empty @ROCM_PATH@/lib - rmdir --ignore-fail-on-non-empty @ROCM_PATH@ + if [ -e "@ROCM_PATH@" ] ; then + if [ -e "@ROCM_PATH@/lib" ] ; then + rmdir --ignore-fail-on-non-empty @ROCM_PATH@/lib + fi + rmdir --ignore-fail-on-non-empty @ROCM_PATH@ + fi rm_ldconfig ;; *)