mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-07-01 03:39:39 +02:00
modulecmd: use_overlay() improve code for overlays of type replacing
This commit is contained in:
@@ -1448,18 +1448,18 @@ subcommand_use() {
|
||||
esac
|
||||
|
||||
if [[ "${ol_type}" == "${ol_replacing}" ]]; then
|
||||
# if this overlay replaces groups, we have to remove
|
||||
# the modules made available by other overlays in these groups
|
||||
# if this overlay replaces groups, we have
|
||||
# to remove the modules made available by
|
||||
# other overlays in these groups
|
||||
for group in ${UsedGroups//:/ }; do
|
||||
# first test whether this group is in the to be added overlay
|
||||
# is this group in the to be added overlay?
|
||||
local dir="${ol_dir}/"
|
||||
dir+="${group}/${PMODULES_MODULEFILES_DIR}"
|
||||
[[ -d "${dir}" ]] || continue # no
|
||||
|
||||
for dir in "${OverlayList[@]}"; do
|
||||
dir+="/${group}/${PMODULES_MODULEFILES_DIR}"
|
||||
std::remove_path MODULEPATH "${dir}"
|
||||
done
|
||||
|
||||
dir="/${group}/${PMODULES_MODULEFILES_DIR}"
|
||||
local -a dirs=( "${OverlayList[@]/%/${dir}}" )
|
||||
std::remove_path MODULEPATH "${dirs[@]}"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user