diff options
author | Tim Fuller <tjfulle@sandia.gov> | 2018-10-31 21:07:07 -0600 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-10-31 20:07:07 -0700 |
commit | fc25ba1b2290bcf17e35e068ccce0f5defed1c04 (patch) | |
tree | b9456c5b6965c5a7e5397e063168f0e825d978f7 /lib | |
parent | fb849a4b7f1361fe276e0761b6fdd73195ea1600 (diff) | |
download | spack-fc25ba1b2290bcf17e35e068ccce0f5defed1c04.tar.gz spack-fc25ba1b2290bcf17e35e068ccce0f5defed1c04.tar.bz2 spack-fc25ba1b2290bcf17e35e068ccce0f5defed1c04.tar.xz spack-fc25ba1b2290bcf17e35e068ccce0f5defed1c04.zip |
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}"
```
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/spec.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 |