From a740337067d4faadfed9aa4dc74c4d654716b3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Dec 2024 10:55:22 +0100 Subject: [PATCH 1/6] use variable for path to CVMFS repository --- init/lmod/bash | 6 ++++-- init/lmod/csh | 6 ++++-- init/lmod/fish | 6 ++++-- init/lmod/ksh | 6 ++++-- init/lmod/zsh | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/init/lmod/bash b/init/lmod/bash index b4941d6766..b2db9a8802 100644 --- a/init/lmod/bash +++ b/init/lmod/bash @@ -1,8 +1,10 @@ +# Choose an EESSI CVMFS repository +EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" # Choose an EESSI version EESSI_VERSION="${EESSI_VERSION:-2023.06}" # Path to top-level module tree -export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules -. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/bash +export MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" +. "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/bash" if [ -z "$__Init_Default_Modules" ]; then export __Init_Default_Modules=1; diff --git a/init/lmod/csh b/init/lmod/csh index 8e50d5e5c8..f2e9100255 100644 --- a/init/lmod/csh +++ b/init/lmod/csh @@ -1,8 +1,10 @@ +# Choose an EESSI CVMFS repository +if (! $?EESSI_CVMFS_REPO) then; set EESSI_CVMFS_REPO = "/cvmfs/software.eessi.io"; endif # Choose an EESSI version if (! $?EESSI_VERSION) then; set EESSI_VERSION = "2023.06"; endif # Path to top-level module tree -setenv MODULEPATH /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules -source /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/`uname -m`/usr/share/Lmod/init/csh +setenv MODULEPATH "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" +source "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/csh" if (! $?__Init_Default_Modules ) then setenv __Init_Default_Modules 1; diff --git a/init/lmod/fish b/init/lmod/fish index d4252ef32a..e0c3b58b31 100644 --- a/init/lmod/fish +++ b/init/lmod/fish @@ -1,8 +1,10 @@ +# Choose an EESSI CVMFS repository +set EESSI_CVMFS_REPO (set -q EESSI_CVMFS_REPO; and echo "$EESSI_CVMFS_REPO"; or echo "/cvmfs/software.eessi.io") # Choose an EESSI version set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") # Path to top-level module tree -set -x MODULEPATH /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules -. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/(uname -m)/usr/share/Lmod/init/fish +set -x MODULEPATH MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" +. "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/fish" if test -z "$__Init_Default_Modules" export __Init_Default_Modules=1; diff --git a/init/lmod/ksh b/init/lmod/ksh index 71dc29542f..7d9a05d688 100644 --- a/init/lmod/ksh +++ b/init/lmod/ksh @@ -1,8 +1,10 @@ +# Choose an EESSI CVMFS repository +EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" # Choose an EESSI version EESSI_VERSION="${EESSI_VERSION:-2023.06}" # Path to top-level module tree -export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules -. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/ksh +export MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" +. "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/ksh" if [ -z "$__Init_Default_Modules" ]; then export __Init_Default_Modules=1; diff --git a/init/lmod/zsh b/init/lmod/zsh index 5f605579c8..bc6e8e4deb 100644 --- a/init/lmod/zsh +++ b/init/lmod/zsh @@ -1,8 +1,10 @@ +# Choose an EESSI CVMFS repository +EESSI_CVMFS_REPO="${EESSI_CVMFS_REPO:-/cvmfs/software.eessi.io}" # Choose an EESSI version EESSI_VERSION="${EESSI_VERSION:-2023.06}" # Path to top-level module tree -export MODULEPATH=/cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/init/modules -. /cvmfs/software.eessi.io/versions/"$EESSI_VERSION"/compat/linux/$(uname -m)/usr/share/Lmod/init/zsh +export MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" +. "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/zsh" if [ -z "$__Init_Default_Modules" ]; then export __Init_Default_Modules=1; From 33775dc20e0fa336c107aca016e291f836fc3c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Dec 2024 11:00:28 +0100 Subject: [PATCH 2/6] remove curly brackets, not supported in fish --- init/lmod/fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/lmod/fish b/init/lmod/fish index e0c3b58b31..1098108b1b 100644 --- a/init/lmod/fish +++ b/init/lmod/fish @@ -3,8 +3,8 @@ set EESSI_CVMFS_REPO (set -q EESSI_CVMFS_REPO; and echo "$EESSI_CVMFS_REPO"; or # Choose an EESSI version set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") # Path to top-level module tree -set -x MODULEPATH MODULEPATH="${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/modules" -. "${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/compat/linux/$(uname -m)/usr/share/Lmod/init/fish" +set -x MODULEPATH MODULEPATH="$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/init/modules" +. "$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/compat/linux/$(uname -m)/usr/share/Lmod/init/fish" if test -z "$__Init_Default_Modules" export __Init_Default_Modules=1; From 8ef745d267e14e5847f542d881e0d7920bdb7b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Dec 2024 11:10:20 +0100 Subject: [PATCH 3/6] restore correct syntax for fish command substitution --- init/lmod/fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/lmod/fish b/init/lmod/fish index 1098108b1b..aceee3f725 100644 --- a/init/lmod/fish +++ b/init/lmod/fish @@ -4,7 +4,7 @@ set EESSI_CVMFS_REPO (set -q EESSI_CVMFS_REPO; and echo "$EESSI_CVMFS_REPO"; or set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") # Path to top-level module tree set -x MODULEPATH MODULEPATH="$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/init/modules" -. "$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/compat/linux/$(uname -m)/usr/share/Lmod/init/fish" +. "$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/compat/linux/(uname -m)/usr/share/Lmod/init/fish" if test -z "$__Init_Default_Modules" export __Init_Default_Modules=1; From 37f6f02d4dba950b2592ca5e851b6d867342d78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Dec 2024 11:13:25 +0100 Subject: [PATCH 4/6] fix syntax for strings with variables --- init/lmod/fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/lmod/fish b/init/lmod/fish index aceee3f725..9e85ba8610 100644 --- a/init/lmod/fish +++ b/init/lmod/fish @@ -3,8 +3,8 @@ set EESSI_CVMFS_REPO (set -q EESSI_CVMFS_REPO; and echo "$EESSI_CVMFS_REPO"; or # Choose an EESSI version set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") # Path to top-level module tree -set -x MODULEPATH MODULEPATH="$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/init/modules" -. "$EESSI_CVMFS_REPO/versions/$EESSI_VERSION/compat/linux/(uname -m)/usr/share/Lmod/init/fish" +set -x MODULEPATH MODULEPATH="$EESSI_CVMFS_REPO"/versions/"$EESSI_VERSION"/init/modules +. "$EESSI_CVMFS_REPO}"/versions/"$EESSI_VERSION"/compat/linux/(uname -m)/usr/share/Lmod/init/fish if test -z "$__Init_Default_Modules" export __Init_Default_Modules=1; From a8baf5bb666e7f8a7d43c18fc1152a1cf63694be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Dec 2024 11:17:20 +0100 Subject: [PATCH 5/6] fix typo --- init/lmod/fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/lmod/fish b/init/lmod/fish index 9e85ba8610..c7d729368f 100644 --- a/init/lmod/fish +++ b/init/lmod/fish @@ -4,7 +4,7 @@ set EESSI_CVMFS_REPO (set -q EESSI_CVMFS_REPO; and echo "$EESSI_CVMFS_REPO"; or set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") # Path to top-level module tree set -x MODULEPATH MODULEPATH="$EESSI_CVMFS_REPO"/versions/"$EESSI_VERSION"/init/modules -. "$EESSI_CVMFS_REPO}"/versions/"$EESSI_VERSION"/compat/linux/(uname -m)/usr/share/Lmod/init/fish +. "$EESSI_CVMFS_REPO"/versions/"$EESSI_VERSION"/compat/linux/(uname -m)/usr/share/Lmod/init/fish if test -z "$__Init_Default_Modules" export __Init_Default_Modules=1; From c0243806af1c42af534be5fffb8826a2446e8c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 6 Dec 2024 11:22:09 +0100 Subject: [PATCH 6/6] fix copy-paste error --- init/lmod/fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/lmod/fish b/init/lmod/fish index c7d729368f..46cd7cacf4 100644 --- a/init/lmod/fish +++ b/init/lmod/fish @@ -3,7 +3,7 @@ set EESSI_CVMFS_REPO (set -q EESSI_CVMFS_REPO; and echo "$EESSI_CVMFS_REPO"; or # Choose an EESSI version set EESSI_VERSION (set -q EESSI_VERSION; and echo "$EESSI_VERSION"; or echo "2023.06") # Path to top-level module tree -set -x MODULEPATH MODULEPATH="$EESSI_CVMFS_REPO"/versions/"$EESSI_VERSION"/init/modules +set -x MODULEPATH "$EESSI_CVMFS_REPO"/versions/"$EESSI_VERSION"/init/modules . "$EESSI_CVMFS_REPO"/versions/"$EESSI_VERSION"/compat/linux/(uname -m)/usr/share/Lmod/init/fish if test -z "$__Init_Default_Modules"