From 0560af8eb7ddea0aa31377527fb5f3501bd32bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 3 Feb 2025 16:49:15 +0100 Subject: [PATCH] better workaround for permission issues with the recreated installation dir --- EESSI-remove-software.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EESSI-remove-software.sh b/EESSI-remove-software.sh index e4b377fd16..c35c7bc469 100755 --- a/EESSI-remove-software.sh +++ b/EESSI-remove-software.sh @@ -130,13 +130,13 @@ if [ $EUID -eq 0 ]; then echo_yellow "Removing ${app_dir} and ${app_module}..." rm -rf ${app_dir} rm -rf ${app_module} - # recreate the installation directories and first-level subdirectories to work around permission denied - # issues when rebuilding the package (see https://github.com/EESSI/software-layer/issues/556) + # recreate the installation directory and do an ls on the first-level subdirectories to work around + # permission issues when reinstalling the application (see https://github.com/EESSI/software-layer/issues/556) echo_yellow "Recreating an empty ${app_dir}..." mkdir -p ${app_dir} - for app_subdir in ${app_subdirs}; do - mkdir -p ${app_subdir} - done + # these subdirs don't (and shouldn't) exist, but we need to do the ls anyway as a workaround, + # so redirect to /dev/null and ignore the exit code + ls ${app_subdirs} >& /dev/null || true done else fatal_error "Easystack file ${easystack_file} not found!"