summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages
diff options
context:
space:
mode:
authorXavier Delaruelle <xavier.delaruelle@cea.fr>2023-06-26 11:55:57 +0200
committerGitHub <noreply@github.com>2023-06-26 11:55:57 +0200
commit81647122645477ee42c40e0683de044a4e7722fc (patch)
tree847b7ab093a9d2e553e0389bfa7b8716f7fbda92 /var/spack/repos/builtin.mock/packages
parentce0b9ea8cf184c9048cac1ae88f2d69f0e4520c7 (diff)
downloadspack-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/spack/repos/builtin.mock/packages')
-rw-r--r--var/spack/repos/builtin.mock/packages/module-setenv-raw/package.py16
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)