Skip to content

Commit

Permalink
disable hook, use recursive rm and do ls on specific directory
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Nov 14, 2024
1 parent f760fd2 commit 7315145
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
34 changes: 19 additions & 15 deletions EESSI-remove-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,25 @@ if [ $EUID -ne 0 ]; then
# app_dir=${EASYBUILD_INSTALLPATH}/software/${app}
# app_module=${EASYBUILD_INSTALLPATH}/modules/all/${app}.lua
echo_yellow "Removing ${app_dir} and ${app_module}..."
# rm -rdfv ${app_dir}
# rm -rdfv ${app_module}
# 1st remove files in depth-first order
for filepath in $(find ${app_dir} -depth -type f); do
echo " removing file ${filepath}"
rm -fv ${filepath}
done
# 2nd remove directories in depth-first order
for dirpath in $(find ${app_dir} -depth -type d); do
echo " removing directory ${dirpath}"
rmdir -v ${dirpath}
done
# 3rd remove module file
echo " removing module file ${app_module}"
rm -fv ${app_module}
# suggestion: use the recursive rm's and ls a specific
# directory only (${app_dir}/easybuild)
rm -rdfv ${app_dir}
rm -rdfv ${app_module}
ls ${app_dir}/easybuild || true

## 1st remove files in depth-first order
#for filepath in $(find ${app_dir} -depth -type f); do
# echo " removing file ${filepath}"
# rm -fv ${filepath}
#done
## 2nd remove directories in depth-first order
#for dirpath in $(find ${app_dir} -depth -type d); do
# echo " removing directory ${dirpath}"
# rmdir -v ${dirpath}
#done
## 3rd remove module file
#echo " removing module file ${app_module}"
#rm -fv ${app_module}
done
else
fatal_error "Easystack file ${easystack_file} not found!"
Expand Down
2 changes: 1 addition & 1 deletion eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,5 +1049,5 @@ def pre_package_eessi_extend(self, *args, **kwargs):
}

PRE_PACKAGE_HOOKS = {
'EESSI-extend': pre_package_eessi_extend,
# 'EESSI-extend': pre_package_eessi_extend,
}

0 comments on commit 7315145

Please sign in to comment.