diff options
author | Xavier Delaruelle <xavier.delaruelle@cea.fr> | 2023-06-26 11:55:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-26 11:55:57 +0200 |
commit | 81647122645477ee42c40e0683de044a4e7722fc (patch) | |
tree | 847b7ab093a9d2e553e0389bfa7b8716f7fbda92 /var | |
parent | ce0b9ea8cf184c9048cac1ae88f2d69f0e4520c7 (diff) | |
download | spack-81647122645477ee42c40e0683de044a4e7722fc.tar.gz spack-81647122645477ee42c40e0683de044a4e7722fc.tar.bz2 spack-81647122645477ee42c40e0683de044a4e7722fc.tar.xz spack-81647122645477ee42c40e0683de044a4e7722fc.zip |
Add raw attribute to env.set command (#38465)
Update `env.set` command and underlying `SetEnv` object to add the `raw`
boolean attribute. `raw` is optional and set to False by default. When
set to True, value format is skipped for object when generating
environment modifications.
With this change it is now possible to define environment variable
whose value contains variable reference syntax (like `{foo}` or `{}`)
that should be set as-is.
Fixes #29578
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/module-setenv-raw/package.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/module-setenv-raw/package.py b/var/spack/repos/builtin.mock/packages/module-setenv-raw/package.py new file mode 100644 index 0000000000..106ff2da22 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/module-setenv-raw/package.py @@ -0,0 +1,16 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class ModuleSetenvRaw(Package): + homepage = "http://www.llnl.gov" + url = "http://www.llnl.gov/module-setenv-raw-1.0.tar.gz" + + version("1.0", "0123456789abcdef0123456789abcdef") + + def setup_run_environment(self, env): + env.set("FOO", "{{name}}, {name}, {{}}, {}", raw=True) |