bootstrap:

- add options to overwrite installation root and configuration file
This commit is contained in:
2017-05-17 12:56:22 +02:00
parent 1d4b3de94c
commit f5bf857cee
3 changed files with 78 additions and 4 deletions
+36 -3
View File
@@ -1,6 +1,39 @@
#!/bin/bash
declare -r BASE_DIR=$(cd "$(dirname $0)" && pwd)
${BASE_DIR}/compile_pmodules.sh || exit 1
${BASE_DIR}/install_pmodules.sh || exit 1
declare -a opts=()
while (( $# > 0 )); do
case $1 in
--debug )
opts+=( "$1" )
;;
--config )
opts+=( "$1=$2" )
shift 1
;;
--config=* )
opts+=( "$1" )
;;
--install-root )
opts+=( "$1=$2" )
shift 1
;;
--install-root=* )
opts+=( "$1" )
;;
-f | --force )
opts+=( "$1" )
;;
-* )
std::die 1 "$1: illegal option"
;;
* )
std::die 1 "No arguments are allowed."
;;
esac
shift 1
done
${BASE_DIR}/compile_pmodules.sh "${opts[@]}" || exit 1
${BASE_DIR}/install_pmodules.sh "${opts[@]}" || exit 1
+18 -1
View File
@@ -2,12 +2,14 @@
declare -r BOOTSTRAP_DIR=$(dirname "$0")
unset PMODULES_ROOT
unset PMODULES_HOME
unset PMODULES_VERSION
source "${BOOTSTRAP_DIR}/Pmodules/libstd.bash"
declare force='no'
declare config_file="${BOOTSTRAP_DIR}/config/environment.bash"
declare opts='--bootstrap'
while (( $# > 0 )); do
@@ -18,6 +20,20 @@ while (( $# > 0 )); do
--debug )
opts+=" $1"
;;
--config )
config_file="$2"
shift 1
;;
--config=* )
config_file="${1#*=}"
;;
--install-root )
PMODULES_ROOT="$2"
shift 1
;;
--install-root=* )
PMODULES_ROOT="${1#*=}"
;;
-f | --force )
force='yes'
;;
@@ -32,7 +48,8 @@ while (( $# > 0 )); do
done
std::read_versions "${BOOTSTRAP_DIR}/config/versions.conf"
source "${BOOTSTRAP_DIR}/config/environment.bash"
source "${config_file}"
PMODULES_VERSION=''
declare -x PMODULES_VERSION
echo $PMODULES_VERSION
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
#
#
# define PMODULES_ROOT only if it has not been passed as argument
# to build/install scripts
#
if [[ -z "${PMODULES_ROOT}" ]]; then
declare -x PMODULES_ROOT='/home/psi.local'
fi
declare -x PMODULES_CONFIG_DIR='config'
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_TEMPLATES_DIR='templates'
declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
declare -x PMODULES_DEFAULT_GROUPS='Tools Programming'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
declare -x PMODULES_DEFAULT_RELEASES='stable'
declare -x PMODULES_DISTFILESDIR='/afs/psi.ch/software/Pmodules/distfiles'
declare -x PMODULES_TMPDIR="/var/tmp/${USER}"