From 0751e9c7435e6fa411e27f1254af0e40fc846bee Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 28 Apr 2021 00:45:05 +0200 Subject: [PATCH] modulecnd.bash.in: find_module(): changes in arguments $3 and $4 - $3 is now the module to load - $4 is now an array of the splitted MODULEPATH --- Pmodules/modulecmd.bash.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 40c14a3..aa37ae7 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -563,7 +563,7 @@ subcommand_load() { fi fi # handle extended module names local release='' - find_module current_modulefile release "${MODULEPATH}" "${m}" + find_module current_modulefile release "${m}" "${modulepath[@]}" if [[ -z ${current_modulefile} ]]; then local text='' get_load_hints text @@ -902,8 +902,8 @@ get_available_modules() { # find module(file) to load. Input arguments are # $1 upvar: return module file # $2 upvar: return module release -# $3 a modulepath (usually MODULEPATH) -# $4 module to load +# $3 module to load +# $4 a modulepath (usually MODULEPATH) # # The module name can be # name @@ -918,10 +918,10 @@ get_available_modules() { # if no modulefile could be found # find_module() { - IFS=':' - local -a dirs=($3) - IFS=${__IFS} - local -r module="$4" + local "$1" + local "$2" + local -r module="$3" + local -a dirs=("${@:4}") for dir in "${dirs[@]}"; do test -d "${dir}" || continue