From 6a7ae8ed52deef7ddee8ab4a57cb5b9ccc431472 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 14:50:41 +0100 Subject: [PATCH] scripts/Bootstrap/Pmodules/bash: run module purge and re-initialize everything --- scripts/Bootstrap/Pmodules/bash | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/bash b/scripts/Bootstrap/Pmodules/bash index e55b9dc..e2276b6 100644 --- a/scripts/Bootstrap/Pmodules/bash +++ b/scripts/Bootstrap/Pmodules/bash @@ -117,24 +117,18 @@ function replace_path () { sed '/^\s*$/d' | tr "\n" ":" | sed -e 's|^:||' -e 's|:$||') } +module purge + ############################################################################# # setup environment # -if [[ -z ${LOADEDMODULES} ]]; then - declare -x LOADEDMODULES='' -fi - -if [[ -z ${MODULEPATH} ]]; then - declare -x MODULEPATH='' - for f in ${PSI_DEFAULT_FAMILIES}; do - append_path MODULEPATH "${PSI_PREFIX}/${PSI_MODULES_ROOT}/$f" - append_path PSI_LOADEDFAMILIES "${f}" - done -fi - -if [[ -z ${PSI_LOADEDFAMILIES} ]]; then - declare -x PSI_LOADEDFAMILIES='' -fi +declare -x LOADEDMODULES='' +declare -x PSI_LOADEDFAMILIES='' +declare -x MODULEPATH='' +for f in ${PSI_DEFAULT_FAMILIES}; do + append_path MODULEPATH "${PSI_PREFIX}/${PSI_MODULES_ROOT}/$f" + append_path PSI_LOADEDFAMILIES "${f}" +done replace_path PATH "${PMODULES_HOME%/*}/.*" replace_path MANPATH "${PMODULES_HOME%/*}/.*" @@ -151,9 +145,6 @@ fi ############################################################################# # legacy... # -#declare -x MODULE_VERSION=${PMODULES_VERSION} -#declare -x MODULE_VERSION_STACK="${PMODULE_VERSION}" -#declare -x MODULESHOME="${PMODULES_HOME}" unset MODULE_VERSION unset MODULE_VERSION_STACK unset MODULESHOME