From f1f66349c20eb241b7bcf34d21333586467cca06 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 12 Mar 2019 14:54:52 +0100 Subject: [PATCH] fixes in modulecmd.bash.in - fix issue with "puts stderr "foo bar" in modulefiles - comment to subcommand_unload() edited --- Pmodules/modulecmd.bash.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index c0ff882..4ebb82a 100755 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -825,9 +825,14 @@ subcommand_load() { echo "${output}" eval "${output}" local error=$( < "${tmpfile}") - #echo "${error}" 1>&2 + + # :FIXME: Not sure whether this is now correct! + # The idea is to supress the error messages from the Tcl modulecmd, but not + # the output to stderr coded in a modulefile. if [[ "${error}" =~ ":ERROR:" ]]; then std::info "${CMD} load: failed -- ${m}\n" + elif [[ -n ${error} ]]; then + echo "${error}" 1>&2 fi if [[ ${verbosity_lvl} != silent ]] && [[ ${release} != stable ]]; then std::info "Warning: the ${release} module '${m}' has been loaded.\n" @@ -847,7 +852,9 @@ subcommand_load() { # subcommand_unload() { # :FIXME: add dependency tests: don't unload if module is required be - # another module + # another module. + # For the time being the modules requiring this module will be + # unloaded too. while (( $# > 0 )); do subcommand_generic1 unload "$1" shift