From f446d4cae9daf2e9b275caffca9f020196a0dd82 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 13 May 2019 16:42:27 +0200 Subject: [PATCH 1/4] libstd.bash: fixes in append_path() and prepend_path() - use export instead of eval --- Pmodules/libstd.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Pmodules/libstd.bash b/Pmodules/libstd.bash index ad7f0e6..846484d 100644 --- a/Pmodules/libstd.bash +++ b/Pmodules/libstd.bash @@ -67,14 +67,14 @@ std::get_abspath() { } std::append_path () { - local -r P="$1" - local -r d="$2" + local -r P=$1 + local -r d=$2 if ! echo ${!P} | egrep -q "(^|:)${d}($|:)" ; then if [[ -z ${!P} ]]; then - eval $P=\"${d}\" + export "$P=${d}" else - eval $P=\"${!P}:${d}\" + export "$P=${!P}:${d}" fi fi } @@ -85,9 +85,9 @@ std::prepend_path () { if ! echo ${!P} | egrep -q "(^|:)${d}($|:)" ; then if [[ -z ${!P} ]]; then - eval $P=${d} + export "$P=${d}" else - eval $P=${d}:${!P} + export "$P=${d}:${!P}" fi fi } From 2c92aa659d5d43ca55d77a4728e52d93575b219a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 13 May 2019 16:44:11 +0200 Subject: [PATCH 2/4] prepend Pmodules bin directory to PATH --- Pmodules/bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pmodules/bash b/Pmodules/bash index 893730f..22486e0 100644 --- a/Pmodules/bash +++ b/Pmodules/bash @@ -34,6 +34,8 @@ unset MODULE_VERSION unset MODULE_VERSION_STACK unset MODULESHOME +PATH="${PMODULES_HOME}/bin:$PATH" + ############################################################################# # implement module comand as shell function # From 6ef4dd3667ca775161addcbef4a873accd2646cd Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 13 May 2019 16:47:17 +0200 Subject: [PATCH 3/4] bugs in initialization of PATH fixed in modulecmd.bash.in - prepend Pmodules bin directory to PATH - export MANPATH --- 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 dd163d4..a52ba79 100755 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1410,7 +1410,7 @@ subcommand_list() { init_path() { std::replace_path PATH "${PMODULES_HOME%/*}/.*" - std::append_path PATH "${PMODULES_HOME}/bin" + std::prepend_path PATH "${PMODULES_HOME}/bin" } init_manpath() { @@ -1450,7 +1450,8 @@ pmodules_init() { LOADEDMODULES \ _LMFILES_ \ MODULEPATH \ - PATH + PATH \ + MANPATH } ############################################################################## From 8b67fd45a31df63c0b625236bf34b822482b6b85 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 13 May 2019 16:47:56 +0200 Subject: [PATCH 4/4] cleanup double exports in profile.bash.in --- Pmodules/profile.bash.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Pmodules/profile.bash.in b/Pmodules/profile.bash.in index 11ddef7..3cc380c 100644 --- a/Pmodules/profile.bash.in +++ b/Pmodules/profile.bash.in @@ -12,10 +12,6 @@ # set default version : ${PMODULES_VERSION:=@PMODULES_VERSION@} -export PMODULES_DEFAULT_GROUPS -export PMODULES_DEFAULT_RELEASES -export PMODULES_VERSION - ############################################################################# # N O C H A N G E S B E L O W T H I S L I N E ! # #