Files
Pmodules/Pmodules/profile.bash.in
T
gsell b80f27d2e3 - merge scripts 'configure', 'compile_pmodules' and 'install_pmodules'
into new script 'build'
- merge 'environment.{bash,csh}.in' into 'profile.{bash,csh}.in'
- set version to 0.99.12
2017-05-31 15:22:48 +02:00

63 lines
2.0 KiB
Bash

#!/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}
#
: ${PMODULES_DEFAULT_GROUPS:='Tools Programming'}
: ${PMODULES_DEFAULT_RELEASES:='stable'}
: ${PMODULES_VERSION:="@PMODULES_VERSION@}"
#############################################################################
# N O C H A N G E S B E L O W T H I S L I N E ! #
#############################################################################
declare -x PMODULES_DEFAULT_GROUPS
declare -x PMODULES_DEFAULT_RELEASES
declare -x PMODULES_VERSION
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
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}"
declare -x PMODULES_TEMPLATES_DIR='templates'
declare -x PMODULES_DISTFILESDIR="@PMODULES_DISTFILESDIR@"
declare -x PMODULES_TMPDIR="@PMODULES_TMPDIR@"
############################################################################
# some sanity checks
#
if [[ ! -d ${PMODULES_ROOT} ]]; then
echo "Oops: ${PMODULES_ROOT}: Set as Pmodules root, but this is not a directory." 1>&2
return 1
fi
if [[ ! -d ${PMODULES_HOME} ]]; then
echo "Oops: ${PMODULES_HOME}: Set as Pmodules home, but this is not a directory." 1>&2
return 1
fi
############################################################################
# inititialize Pmodules for bash
#
_init_bash="${PMODULES_HOME}/init/bash"
if [[ ! -r "${_init_bash}" ]]; then
echo "Oops: cannot initialize Modules!"
echo "${_init_bash}: File does not exist or is not readable."
return 1
fi
source "${_init_bash}"
unset _init_bash
# Local Variables:
# mode: sh
# sh-basic-offset: 8
# tab-width: 8
# End: