Skip to content

Commit

Permalink
Merge pull request #426 from TopRichard/nessi-2023.06-init-script-bash
Browse files Browse the repository at this point in the history
Allow initialisation scripts to be used with bash < 4.2
  • Loading branch information
TopRichard authored Jul 19, 2024
2 parents 9ca496c + 6db7c38 commit 7f33d9c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion init/bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function show_msg {
# only echo msg if EESSI_SILENT is unset
msg=$1
if [[ ! -v EESSI_SILENT ]]; then
if [[ -z ${EESSI_SILENT+x} ]]; then
echo "$msg"
fi
}
Expand Down
16 changes: 14 additions & 2 deletions init/eessi_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@
# license: GPLv2
#

export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/pilot.nessi.no}"
export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=2023.06}"
# use different defaults for RISC-V, as we want to redirect to the riscv.eessi.io repo
#if [[ $(uname -m) == "riscv64" ]]; then
# export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/riscv.eessi.io}"
# export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=20240402}"
# if [[ -z ${EESSI_SILENT+x} ]]; then
# echo "RISC-V architecture detected, but there is no RISC-V support yet in the production repository."
# echo "Automatically switching to version ${EESSI_VERSION} of the RISC-V development repository ${EESSI_CVMFS_REPO}."
# echo "For more details about this repository, see https://www.eessi.io/docs/repositories/riscv.eessi.io/."
# echo ""
# fi
#else
export EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO_OVERRIDE:=/cvmfs/pilot.nessi.no}"
export EESSI_VERSION="${EESSI_VERSION_OVERRIDE:=2023.06}"
#fi
# use archdetect by default, unless otherwise specified
export EESSI_USE_ARCHDETECT="${EESSI_USE_ARCHDETECT:=1}"
export EESSI_USE_ARCHSPEC="${EESSI_USE_ARCHSPEC:=0}"
2 changes: 1 addition & 1 deletion init/eessi_environment_variables
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function error() {
function show_msg {
# only echo msg if EESSI_SILENT is unset
msg=$1
if [[ ! -v EESSI_SILENT ]]; then
if [[ -z ${EESSI_SILENT+x} ]]; then
echo "$msg"
fi
}
Expand Down

0 comments on commit 7f33d9c

Please sign in to comment.