Commit 25d15181 authored by gsell's avatar gsell
Browse files

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

parents 2df04b8a 65aad9aa
#!/bin/bash
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
# disable auto-echo feature of 'cd'
unset CDPATH
......@@ -19,9 +17,15 @@ declare -rx BUILD_BASEDIR=$(abspath $SHLIBDIR/..)
PATH=/usr/bin:/bin:/usr/sbin:/sbin
declare -r OS=$(uname -s)
if [[ "${OS}" == "Darwin" ]]; then
# :FIXME: why do we need this?
[[ -d "/opt/X11/bin" ]] && PATH+=':/opt/X11/bin'
fi
# number of parallel make jobs
declare -i JOBS=3
......
......@@ -3,7 +3,7 @@ if ($?tcsh) then
else
set modules_shell="csh"
endif
set exec_prefix='/usr/bin'
set exec_prefix = $PMODULES_HOME/bin'
set prefix=""
set postfix=""
......@@ -34,7 +34,6 @@ unset exec_prefix
unset prefix
unset postfix
setenv MODULESHOME /usr/share/Modules
if (! $?MODULEPATH ) then
setenv MODULEPATH `sed -n 's/[ #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' ${MODULESHOME}/init/.modulespath`
......
#!/bin/tcsh
setenv PSI_PREFIX "/opt/psi"
setenv PMODULES_ROOT "/opt/psi"
if ( "$PMODULES_VERSION" == "" ) then
setenv PMODULES_VERSION "0.99.1"
if ( ! $?PMODULES_VERSION ) then
setenv PMODULES_VERSION "@PMODULES_VERSION@"
endif
setenv PMODULES_HOME "$PSI_PREFIX/Tools/Pmodules/$PMODULES_VERSION"
setenv PMODULES_HOME "$PMODULES_ROOT/Tools/Pmodules/$PMODULES_VERSION"
setenv PMODULES_DIR "${PMODULES_HOME}"
setenv PSI_CONFIG_DIR "config"
setenv PSI_MODULES_ROOT 'modulefiles'
setenv PSI_TEMPLATES_DIR 'templates'
setenv PMODULES_CONFIG_DIR 'config'
setenv PMODULES_MODULEFILES_DIR 'modulefiles'
setenv PMODULES_TEMPLATES_DIR 'templates'
setenv PSI_DEFAULT_FAMILIES 'Tools Programming'
setenv PSI_RELEASES ':unstable:stable:deprecated:'
setenv PSI_USED_RELEASES 'stable'
setenv PMODULES_DEFAULT_GROUPS 'Tools Programming'
setenv PMODULES_DEFINED_RELEASES ':unstable:stable:deprecated:'
setenv PMODULES_DEFAULT_RELEASES 'stable'
#!@PMODULES_HOME@/bin/bash
#!@PMODULES_HOME@/bin/bash --noprofile --norc
#
#set -o nounset
......@@ -31,21 +31,33 @@ shopt -s nullglob
declare -a Groups='()'
declare -A HierarchyDepths='()'
save_env() {
export_env() {
local s=''
while (( $# > 0 )); do
s+="$( typeset -p $1 );"
shift
done
echo export PMODULES_ENV=$( "${PMODULES_HOME}/bin/base64" --wrap=0 <<< "$s" )
if [[ "${shell}" == "bash" ]]; then
while (( $# > 0 )); do
echo -n "export $1=\"${!1}\";"
shift
done
return
elif [[ "${shell}" == "tcsh" ]]; then
while (( $# > 0 )); do
echo "setenv $1 ${!1}"
shift
done
return
fi
}
export_env() {
save_env() {
local s=''
local tmp
while (( $# > 0 )); do
echo -n "export $1=${!1};"
tmp="$( typeset -p $1 2> /dev/null)"
[[ -n "${tmp}" ]] && s+="${tmp};"
shift
done
declare -g PMODULES_ENV=$( "${PMODULES_HOME}/bin/base64" --wrap=0 <<< "$s" )
export_env PMODULES_ENV
}
trap 'save_env Groups HierarchyDepths UsedReleases PMODULES_DEFAULT_GROUPS PMODULES_DEFINED_RELEASES PMODULES_DEFAULT_RELEASES' EXIT
......@@ -1055,7 +1067,9 @@ subcommand_use() {
fi
shift
done
echo "export PMODULES_USED_GROUPS=${PMODULES_USED_GROUPS}"
#echo "export PMODULES_USED_GROUPS=${PMODULES_USED_GROUPS}"
declare -g PMODULES_USED_GROUPS="${PMODULES_USED_GROUPS}"
export_env PMODULES_USED_GROUPS
[[ ${#dirs_to_add[@]} == 0 ]] && return
for dir in "${dirs_to_add[@]}"; do
......@@ -1113,7 +1127,9 @@ subcommand_unuse() {
fi
shift
done
echo "export PMODULES_USED_GROUPS=${PMODULES_USED_GROUPS}"
#echo "export PMODULES_USED_GROUPS=${PMODULES_USED_GROUPS}"
declare -g PMODULES_USED_GROUPS="${PMODULES_USED_GROUPS}"
export_env PMODULES_USED_GROUPS
[[ ${#dirs_to_remove[@]} == 0 ]] && return
for dir in "${dirs_to_remove[@]}"; do
subcommand_generic1 unuse "${dir}"
......@@ -1180,12 +1196,16 @@ subcommand_list() {
}
pmodules_init() {
declare -g PMODULES_DEFAULT_GROUPS=''
declare -g PMODULES_DEFAULT_RELEASES=''
source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/environment.bash"
declare -g LOADEDMODULES=''
declare -g PMODULES_USED_GROUPS=''
declare -g MODULEPATH=''
declare -g _LMFILES_=''
for group in ${PMODULES_DEFAULT_GROUPS}; do
append_path MODULEPATH "${PMODULES_ROOT}/${group}/${PMODULES_MODULEFILES_DIR}"
append_path PMODULES_USED_GROUPS "${group}"
......@@ -1480,6 +1500,9 @@ case $1 in
bash )
declare shell="$1"
;;
tcsh )
declare shell="$1"
;;
* )
die 1 "${CMD}: unsupported shell -- $1"
;;
......
declare -x PMODULES_VERSION=0.99.3
declare -x PMODULES_VERSION=0.99.4
declare -x MODULES_VERSION=3.2.10
declare -a COMPILER_VERSIONS=( 'gcc/4.7.4' 'gcc/4.8.3' 'gcc/4.8.4' 'gcc/4.9.2' )
......
......@@ -8,6 +8,10 @@ source "${BOOTSTRAP_DIR}/Pmodules_version.conf"
unset PMODULES_HOME
source "/opt/psi/config/environment.bash"
if [[ -n ${PMODULES_DIR} ]] && [[ "${PMODULES_DIR}" != "/" ]] && [[ -d "${PMODULES_DIR}" ]]; then
rm -rf "${PMODULES_DIR}"
fi
${BOOTSTRAP_DIR}/coreutils/build --bootstrap --disable-cleanup || { echo "compiling 'coreutils' failed!"; exit 1; }
${BOOTSTRAP_DIR}/gettext/build --bootstrap --disable-cleanup || { echo "compiling 'gettext' failed!"; exit 1; }
${BOOTSTRAP_DIR}/getopt/build --bootstrap --disable-cleanup || { echo "compiling 'getopt' failed!"; exit 1; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment