diff options
author | Xavier Delaruelle <xavier.delaruelle@cea.fr> | 2023-07-18 10:24:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 10:24:46 +0200 |
commit | 8c7adbf8f3767a06014e014f0132e8f5607cce0d (patch) | |
tree | e0781768cc3569e3dc5a453972c7b6f3efaa5d8f /share | |
parent | 10165397da8bf1b6cd478de752b79cf58ca2b1dc (diff) | |
download | spack-8c7adbf8f3767a06014e014f0132e8f5607cce0d.tar.gz spack-8c7adbf8f3767a06014e014f0132e8f5607cce0d.tar.bz2 spack-8c7adbf8f3767a06014e014f0132e8f5607cce0d.tar.xz spack-8c7adbf8f3767a06014e014f0132e8f5607cce0d.zip |
modules: add support for conflict in lua modulefile (#36701)
Add support for conflict directives in Lua modulefile like done for Tcl
modulefile.
Note that conflicts are correctly honored on Lmod and Environment
Modules <4.2 only if mutually expressed on both modulefiles that
conflict with each other.
Migrate conflict code from Tcl-specific classes to the common part. Add
tests for Lmod and split the conflict test case in two.
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/spack/templates/modules/modulefile.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/share/spack/templates/modules/modulefile.lua b/share/spack/templates/modules/modulefile.lua index f86e76cfe6..65e97f2410 100644 --- a/share/spack/templates/modules/modulefile.lua +++ b/share/spack/templates/modules/modulefile.lua @@ -69,6 +69,12 @@ setenv("LMOD_{{ name|upper() }}_VERSION", "{{ version_part }}") depends_on("{{ module }}") {% endfor %} {% endblock %} +{# #} +{% block conflict %} +{% for name in conflicts %} +conflict("{{ name }}") +{% endfor %} +{% endblock %} {% block environment %} {% for command_name, cmd in environment_modifications %} |