From 1f82ab9debe3d51614d1edad5a99c5c15a2dca46 Mon Sep 17 00:00:00 2001 From: gsell Date: Fri, 23 Aug 2024 13:33:36 +0200 Subject: [PATCH] Merge branch '334-modulecmd-un-using-a-group-is-broken' into 'master' Resolve "modulecmd: un-using a group is broken" Closes #334 See merge request Pmodules/src!313 (cherry picked from commit 850006847302dd994d8f888fff11d45db4bd158d) d639c08b modulecmd: bugfix in un-using a group Co-authored-by: gsell --- Pmodules/modulecmd.bash.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 9edf731..1b443e8 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1962,7 +1962,7 @@ subcommand_unuse() { done done - # remove additional directories added overlay + # remove additional directories added by overlay if [[ -v OverlayInfo[${ol_name}:modulepath] && \ -n "${OverlayInfo[${ol_name}:modulepath]}" ]]; then local -a modulepath=() @@ -1980,6 +1980,7 @@ subcommand_unuse() { for dir in "${modulepath[@]}"; do [[ "${dir}" == "${OverlayInfo[${ol_name}:modulefiles_root]}" ]] && \ std::remove_path MODULEPATH "${dir}" + done export_env UsedOverlays EnvMustBeSaved='yes' @@ -2007,7 +2008,8 @@ subcommand_unuse() { std::remove_path UsedGroups "${arg}" local overlay for overlay in "${UsedOverlays[@]}"; do - local dir="${overlay}/${arg}/${PMODULES_MODULEFILES_DIR}" + local dir="${OverlayInfo[${overlay}:modulefiles_root]}" + dir+="/${arg}/${PMODULES_MODULEFILES_DIR}" std::remove_path MODULEPATH "${dir}" done }