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>
This commit is contained in:
Xavier Delaruelle
2023-07-18 10:24:46 +02:00
committed by GitHub
parent 10165397da
commit 8c7adbf8f3
9 changed files with 119 additions and 56 deletions

View File

@@ -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 %}