Accepting request 1103772 from network:cluster

- Fix SPACK_ROOT setting in /etc/profile.d/spack.[c]sh (bsc#1214222).
- Don't source /etc/os-release directly, use a subshell.

OBS-URL: https://build.opensuse.org/request/show/1103772
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/spack?expand=0&rev=35
This commit is contained in:
Dominique Leuenberger 2023-08-14 20:35:47 +00:00 committed by Git OBS Bridge
commit 7447bcd8b8
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Aug 13 12:21:57 UTC 2023 - Egbert Eich <eich@suse.com>
- Fix SPACK_ROOT setting in /etc/profile.d/spack.[c]sh (bsc#1214222).
- Don't source /etc/os-release directly, use a subshell.
-------------------------------------------------------------------
Mon Jun 26 12:26:10 UTC 2023 - Egbert Eich <eich@suse.com>

View File

@ -366,13 +366,13 @@ EOF
# This file properly sets MODULEPATH so lua-lmod can find the modules created by spack
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
cat > %{buildroot}/%{_sysconfdir}/profile.d/spack.sh <<EOF
source /etc/os-release
ID=\$(source /etc/os-release; echo \${ID})
if [ "\${ID}" = "opensuse-tumbleweed" ] ; then
SPACK_NAME="\${ID/-/}"
else
SPACK_NAME="\${ID/-/_}\${VERSION_ID/.*/}"
fi
export SPACK_ROOT=%{spack_dir}
export SPACK_ROOT=%{_prefix}
export MODULEPATH=~/spack/modules/linux-\${SPACK_NAME}-\${CPU}:%{_prefix}/share/spack/modules/linux-\${SPACK_NAME}-\${CPU}:\${MODULEPATH}
# copy local configuration, if its not there
if [ ! -e ~/.spack/config.yaml ] ; then
@ -398,7 +398,7 @@ if ( \$ID == "opensuse_tumbleweed" ) then
else
set SPACK_NAME="\${ID}\${VERSION_ID}"
endif
set SPACK_ROOT="%{spack_dir}"
set SPACK_ROOT="%{_prefix}"
set MODULEPATH="~/spack/modules/linux-\${SPACK_NAME}-\${CPU}:%{_prefix}/share/spack/modules/linux-\${SPACK_NAME}-\${CPU}:\${MODULEPATH}"
if ( ! -e ~/.spack/config.yaml ) then
# test if user is in spack group by touching database