From fc25ba1b2290bcf17e35e068ccce0f5defed1c04 Mon Sep 17 00:00:00 2001 From: Tim Fuller Date: Wed, 31 Oct 2018 21:07:07 -0600 Subject: Parse the ${NAMESPACE} format string in a spec's format method. (#9686) This allows installing software on a namespace basis by including ${NAMESPACE} in `install_path_scheme`. e.g., ``` cat ~/.spack/config.yaml config: install_path_scheme: "${ARCHITECTURE}/${NAMESPACE}/${COMPILERNAME}-${COMPILERVER}/${PACKAGE}-${VERSION}-${HASH}" ``` --- lib/spack/spack/spec.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index eb2e817736..1579c5c011 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2944,6 +2944,7 @@ class Spec(object): ${SPACK_INSTALL} The default spack install directory, ${SPACK_PREFIX}/opt ${PREFIX} The package prefix + ${NAMESPACE} The package namespace Note these are case-insensitive: for example you can specify either ``${PACKAGE}`` or ``${package}``. @@ -3126,6 +3127,8 @@ class Spec(object): else: hashlen = None out.write(fmt % (self.dag_hash(hashlen))) + elif named_str == 'NAMESPACE': + out.write(fmt % token_transform(self.namespace)) named = False -- cgit v1.2.3-60-g2f50