spack/Make-spack-paths-compliant-to-distro-installation.patch
Egbert Eich 7c56f86278 Accepting request 1057809 from home:eeich:branches:network:cluster
- Fix var_path: this regression was introduced with the update
  to the 0.19.0 release (boo#1207053).
- Move repos to /usr/share/spack: /var is strictly for local data.

OBS-URL: https://build.opensuse.org/request/show/1057809
OBS-URL: https://build.opensuse.org/package/show/network:cluster/spack?expand=0&rev=54
2023-01-11 14:53:34 +00:00

47 lines
1.6 KiB
Diff

From: Egbert Eich <eich@suse.com>
Date: Wed Jan 11 14:30:19 2023 +0100
Subject: Make spack paths compliant to distro installation
Patch-mainline: Not yet
Git-commit: c74fb7ed42aa94609c8cc8c005b004357307bb34
References:
Spack is particular about the choice of 'prefix' which will
replace $spack. 'prefix' is the 4th ancestor of paths.py, so
it is relative to the spack installation.
This will only change the coded setups of
var_path -> /var/lib/spack
opt_path -> /opt/spack
repo_path -> /usr/share/spack/repos
Signed-off-by: Egbert Eich <eich@suse.com>
Signed-off-by: Egbert Eich <eich@suse.de>
---
lib/spack/spack/paths.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/spack/spack/paths.py b/lib/spack/spack/paths.py
index f03f6eb1..914aea93 100644
--- a/lib/spack/spack/paths.py
+++ b/lib/spack/spack/paths.py
@@ -41,7 +41,7 @@
operating_system_path = os.path.join(module_path, "operating_systems")
test_path = os.path.join(module_path, "test")
hooks_path = os.path.join(module_path, "hooks")
-opt_path = os.path.join(prefix, "opt")
+opt_path = os.path.join("/", "opt")
share_path = os.path.join(prefix, "share", "spack")
etc_path = os.path.join(prefix, "etc", "spack")
@@ -53,10 +53,10 @@
#
# Things in $spack/var/spack
#
-var_path = os.path.join(prefix, "var", "spack")
+var_path = os.path.join("/", "var", "lib", "spack")
# read-only things in $spack/var/spack
-repos_path = os.path.join(var_path, "repos")
+repos_path = os.path.join(share_path, "repos")
packages_path = os.path.join(repos_path, "builtin")
mock_packages_path = os.path.join(repos_path, "builtin.mock")