Merge branch 'master' of gitorious.psi.ch:pmodules/src

This commit is contained in:
2015-03-18 18:25:50 +01:00
10 changed files with 174 additions and 177 deletions
+9 -18
View File
@@ -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
+7 -1
View File
@@ -1,5 +1,7 @@
#!@PMODULES_HOME@/bin/bash
unset CDPATH
shopt -s expand_aliases
declare -r bindir=$(cd $(dirname "$0") && pwd)
@@ -141,7 +143,7 @@ subcommand_init() {
local target_prefixes=()
local user=''
local opts=''
opts=$(get_options -o h -l src: -l user: -l help -- "$@")
opts=$(get_options -o h -l src: -l user: -l help -l version: -- "$@")
if [[ $? != 0 ]]; then
subcommand_help_init
exit 1
@@ -157,6 +159,10 @@ subcommand_init() {
user=$2
shift
;;
--version )
PMODULES_VERSION=$2
shift
;;
-- )
:
;;
+12 -1
View File
@@ -1,4 +1,8 @@
#!@PMODULES_HOME@/bin/bash
#
# we have to unset CDPATH, otherwise 'cd' prints the directoy!
unset CDPATH
declare -r PMODULES_DIR=$( cd "$(dirname $0)/.." && pwd )
declare -r version='@PMODULES_VERSION@'
@@ -464,6 +468,11 @@ subcommand_generic1plus() {
"${modulecmd}" "${shell}" "${subcommand}" "$@"
}
#
# load module
#
# $1: module to load
#
subcommand_load() {
output_load_hints() {
local -ra rels=( ${available_releases//:/ } )
@@ -509,7 +518,9 @@ subcommand_load() {
}
local -r m=$1
if module_is_available "${m}"; then
if [[ "${m}" == "" ]]; then
echo "No module specified." 1>&2
elif module_is_available "${m}"; then
"${modulecmd}" "${shell}" load "${m}"
else
if [[ ${userlvl} = 'novice' ]]; then