From 25c302d91cd700c22b6d54ed57542af1a86e0ca4 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 May 2022 10:10:20 +0200 Subject: [PATCH] modulecmd: PMODULES_ENV initialisation fixed PMODULES_ENV must be initialised before modulecmd.bin is called --- Pmodules/modulecmd.bash.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index f1564f1..688dbc9 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -131,12 +131,12 @@ save_env() { vars+=( OverlayDict Dir2OverlayMap) local s=$(typeset -p ${vars[@]}) - declare -g PMODULES_ENV=$( encode_base64 "$s" ) - export_env 'PMODULES_ENV' + declare -gx PMODULES_ENV=$( encode_base64 "$s" ) } _exit() { save_env "${g_env_must_be_saved}" + export_env 'PMODULES_ENV' if [[ -n "${tmpfile}" ]] && [[ -e "${tmpfile}" ]]; then ${rm} -f "${tmpfile}" || : fi @@ -1852,6 +1852,7 @@ pmodules_init() { init_overlay_vars init_modulepath init_manpath + save_env export_env \ LOADEDMODULES \ _LMFILES_ \