Add logic to set the active install tree

This commit is contained in:
Carson Woods
2019-07-17 09:48:12 -06:00
parent 811b304230
commit c61f4d7c82

View File

@@ -1492,6 +1492,17 @@ def do_install(self, **kwargs):
dirty = kwargs.get('dirty', False)
restage = kwargs.get('restage', False)
install_global = kwargs.get('install_global', False)
upstream = kwargs.get('upstream', False)
# Install Package to Global Upstream for multi-user use
if install_global:
global_root = spack.config.get('upstreams')['global']['install_tree']
global_root = spack.util.path.canonicalize_path(global_root)
spack.config.set('config:active_tree', global_root)
elif upstream:
raise NotImplementedError
else:
spack.config.set('config:active_tree', spack.config.get('config:install_tree'))
# For external packages the workflow is simplified, and basically
# consists in module file generation and registration in the DB