From d44ad207657e52da97a7f5d854dbfa24a5763083 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 9 Oct 2014 13:56:44 +0200 Subject: [PATCH] libem.bash: with new BASH we have to re-init the module environment; bugfix in _set_link() --- lib/libem.bash | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index cf4af5e..b86c8dd 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -2,6 +2,11 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin +shopt -s expand_aliases + +source "${PSI_PREFIX}/${PSI_CONFIG_DIR}/profile.bash" +module use unstable + declare -r MODULECMD="${MODULESHOME}/bin/modulecmd" declare -r BUILDSCRIPT=$( cd $(dirname "$0") && pwd )/$(basename "$0") @@ -503,12 +508,13 @@ function em.install_doc() { } function _set_link() { - [[ ${cur_module_release} == ${MODULE_RELEASE} ]] && return 0 local _path if [[ "${cur_module_release}" != '' ]]; then _path="${PSI_PREFIX}/${PSI_MODULES_ROOT}/${MODULE_FAMILY}${cur_module_release/.stable}/${MODULE_NAME}" - info "Removing old sym-link \"${_path}\" ..." - rm "${_path}" + if [[ -e "${_path}" ]]; then + info "Removing old sym-link \"${_path}\" ..." + rm "${_path}" + fi fi ( _path="${PSI_PREFIX}/${PSI_MODULES_ROOT}/${MODULE_FAMILY}${MODULE_RELEASE/.stable}/${MODULE_NAME%/*}"