Add default global upstream of /opt/spack

This commit is contained in:
Carson Woods
2019-07-16 16:09:15 -06:00
parent 088798a727
commit 2b11694b94
2 changed files with 22 additions and 5 deletions

View File

@@ -0,0 +1,7 @@
upstreams:
global:
install_tree: $spack/opt/spack
modules:
tcl: $spack/share/spack/modules
lmod: $spack/share/spack/lmod
dotkit: $spack/share/spack/dotkit

View File

@@ -90,12 +90,22 @@ def _store():
def retrieve_upstream_dbs():
other_spack_instances = spack.config.get('upstreams')
global_fallback = {'global': {'install_tree': '$spack/opt/spack',
'modules':
{'tcl': '$spack/share/spack/modules',
'lmod': '$spack/share/spack/lmod',
'dotkit': '$spack/share/spack/dotkit'}}}
if spack.config.get('config:shared'):
path = spack.util.path.canonicalize_path("$spack/opt/spack")
other_spack_instances.update({'spack-root':
{'install_tree': path}})
other_spack_instances = spack.config.get('upstreams',
global_fallback)
# Canonicalizes upstream paths
temp = other_spack_instances['global']
temp['install_tree'] = spack.util.path.canonicalize_path(
temp['install_tree'])
for mod_type, path in temp['modules'].items():
temp['modules']['mod_type'] = spack.util.path.canonicalize_path(path)
other_spack_instances['global'] = temp
install_roots = []
for install_properties in other_spack_instances.values():