From c619985a2c0e925f7e5751edc5e9b3d41132e9a1 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 6 Feb 2023 10:07:43 +0100 Subject: [PATCH] bugfix in get_available_modules() --- Pmodules/modulecmd.bash.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index bbf28e1..e10d389 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -959,16 +959,16 @@ get_available_modules() { # - new version and not hidden by overlay local name="${mod%/*}" local key="${dir##/${PMODULES_MODULEFILES_DIR}}/${name}" - if [[ -z "${modulenames[${key}]}" ]]; then + if [[ -z "${modulenames[${name}]}" ]]; then if [[ "${OverlayInfo[${ol}:type]}" == "${ol_hiding}" ]]; then - modulenames[${key}]="${ol}" + modulenames[${name}]="${ol}" else - modulenames[${key}]='0' + modulenames[${name}]='0' fi add='yes' - elif [[ "${modulenames[${key}]}" == "${ol}" ]]; then + elif [[ "${modulenames[${name}]}" == "${ol}" ]]; then add='yes' - elif [[ "${modulenames[${key}]}" == '0' ]] \ + elif [[ "${modulenames[${name}]}" == '0' ]] \ && [[ -z ${dict[${mod}]} ]]; then add='yes' fi @@ -976,7 +976,7 @@ get_available_modules() { # module is NOT in an overlay add='yes' fi - [[ "${add}" == 'yes' ]] || continue + [[ "${add}" == 'no' ]] && continue get_release_stage \ rel_stage \ "${dir}" \ @@ -2882,7 +2882,6 @@ done if [[ -z "${subcommand}" ]]; then std::die 1 "${CMD}: no sub-command specified." fi -declare -rx TCL_LIBRARY="${PMODULES_HOME}/lib/tcl@TCL_VERSION@" if [[ -z "${Subcommands[${subcommand}]}" ]]; then std::die 1 "${CMD}: unknown sub-command -- ${subcommand}"