From e5503c54ddc2b7dfccfd98c9f4143c42edeb617e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 10 Jul 2015 18:48:48 +0200 Subject: [PATCH] scripts/Bootstrap/Pmodules/{ennvironment,profile}.bash: - cleanup --- .../Bootstrap/Pmodules/environment.bash.in | 34 +++++++++---------- scripts/Bootstrap/Pmodules/profile.bash | 8 +++-- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/environment.bash.in b/scripts/Bootstrap/Pmodules/environment.bash.in index a11599f..6adb09f 100644 --- a/scripts/Bootstrap/Pmodules/environment.bash.in +++ b/scripts/Bootstrap/Pmodules/environment.bash.in @@ -1,14 +1,12 @@ #!/bin/bash +# +# Notes: +# - PMODULES_ROOT is derived from the location of this file. +# - Some for PMODULES_CONFIG_DIR. +# - The Pmodules software must be installed in +# ${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION} +# -declare -x PMODULES_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd) - -if [[ -z ${PMODULES_VERSION} ]]; then - declare -x PMODULES_VERSION="@PMODULES_VERSION@" -fi -declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}" -declare -x PMODULES_DIR="${PMODULES_HOME}" - -declare -x PMODULES_CONFIG_DIR=$(basename $(cd $(dirname "${BASH_SOURCE}") && pwd)) declare -x PMODULES_MODULEFILES_DIR='modulefiles' declare -x PMODULES_TEMPLATES_DIR='templates' @@ -16,12 +14,14 @@ declare -x PMODULES_DEFAULT_GROUPS='Tools Programming' declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:' declare -x PMODULES_DEFAULT_RELEASES='stable' -# legacy vars -declare -x PSI_PREFIX="${PMODULES_ROOT}" -declare -x PSI_CONFIG_DIR="${PMODULES_CONFIG_DIR}" -declare -x PSI_MODULES_ROOT="${PMODULES_MODULES_ROOT}" -declare -x PSI_TEMPLATES_DIR="${PMODULES_TEMPLATES_DIR}" -declare -x PSI_DEFAULT_FAMILIES="${PMODULES_DEFAULT_GROUPS}" -declare -x PSI_DEFAULT_RELEASES="${PMODULES_DEFAULT_RELEASES}" -declare -x PSI_DEFINED_RELEASES="${PMODULES_DEFINED_RELEASES}" +if [[ -z ${PMODULES_VERSION} ]]; then + declare -x PMODULES_VERSION="@PMODULES_VERSION@" +fi +# +# DO NOT CHANGE THE FOLLOWING LINES! + +declare -x PMODULES_ROOT=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd) +declare -x PMODULES_CONFIG_DIR=$(basename $(cd $(dirname "${BASH_SOURCE}") && pwd)) +declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}" +declare -x PMODULES_DIR="${PMODULES_HOME}" diff --git a/scripts/Bootstrap/Pmodules/profile.bash b/scripts/Bootstrap/Pmodules/profile.bash index 07f4ef2..77e4b6e 100644 --- a/scripts/Bootstrap/Pmodules/profile.bash +++ b/scripts/Bootstrap/Pmodules/profile.bash @@ -1,4 +1,8 @@ #!/bin/bash +# +############################################################################# +# D O N O T C H A N G E T H I S F I L E ! # +############################################################################# ############################################################################# # read Pmodules configuration @@ -27,8 +31,8 @@ if [[ -z ${PMODULES_VERSION} ]]; then echo "Oops: ${PMODULES_VERSION}: Pmodules version not set." 1>&2 return 1 fi -if [[ -z ${PMODULES_HOME} ]]; then - echo "Oops: ${PMODULES_HOME}: Pmodules home not set." 1>&2 +if [[ -z ${PMODULES_HOME} ]]; then + echo "Oops: Pmodules home not set." 1>&2 return 1 fi if [[ ! -d ${PMODULES_HOME} ]]; then