From aa1d74a8eda4188c1938321344fd57a770753004 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 17 Jul 2025 13:00:24 +0200 Subject: [PATCH] modulecmd: review code for searching/available modules --- Pmodules/modulecmd.bash.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index cc67bbc..a59924c 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -791,11 +791,16 @@ subcommand_load() { # get_load_hints() { local -n output="$1" # [out] ref.var to return result - local relstage='' output='' + + local -- search_result="$(set +x; subcommand_search "${m}" -a --no-header 2>&1)" + echo "search: ---" 1>&2 + echo "${search_result}" 1>&2 + echo "search: ---" 1>&2 + local -- relstage='' while read -r -a line; do (( ${#line[@]} == 0 )) && continue - relstage=${line[1]} + relstage="${line[1]}" if [[ ! ":${UsedReleaseStages}:" == *:${relstage}:* ]]; then output+="module use ${relstage}; " fi