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}" ```
This commit is contained in:
parent
fb849a4b7f
commit
fc25ba1b22
@ -2944,6 +2944,7 @@ def format(self, format_string='$_$@$%@+$+$=', **kwargs):
|
|||||||
${SPACK_INSTALL} The default spack install directory,
|
${SPACK_INSTALL} The default spack install directory,
|
||||||
${SPACK_PREFIX}/opt
|
${SPACK_PREFIX}/opt
|
||||||
${PREFIX} The package prefix
|
${PREFIX} The package prefix
|
||||||
|
${NAMESPACE} The package namespace
|
||||||
|
|
||||||
Note these are case-insensitive: for example you can specify either
|
Note these are case-insensitive: for example you can specify either
|
||||||
``${PACKAGE}`` or ``${package}``.
|
``${PACKAGE}`` or ``${package}``.
|
||||||
@ -3126,6 +3127,8 @@ def write(s, c):
|
|||||||
else:
|
else:
|
||||||
hashlen = None
|
hashlen = None
|
||||||
out.write(fmt % (self.dag_hash(hashlen)))
|
out.write(fmt % (self.dag_hash(hashlen)))
|
||||||
|
elif named_str == 'NAMESPACE':
|
||||||
|
out.write(fmt % token_transform(self.namespace))
|
||||||
|
|
||||||
named = False
|
named = False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user