modules: add support for append_flags/remove_flags (#36402)
Adapt tcl and lmod modulefile templates to generate append-path or remove-path commands in modulefile when respectively append_flags or remove_flags commands are defined in package for run environment. Fixes #10299.
This commit is contained in:

committed by
GitHub

parent
ae504ce2fe
commit
c4923fe3b3
@@ -70,9 +70,9 @@ depends_on("{{ module }}")
|
||||
{% for command_name, cmd in environment_modifications %}
|
||||
{% if command_name == 'PrependPath' %}
|
||||
prepend_path("{{ cmd.name }}", "{{ cmd.value }}", "{{ cmd.separator }}")
|
||||
{% elif command_name == 'AppendPath' %}
|
||||
{% elif command_name in ('AppendPath', 'AppendFlagsEnv') %}
|
||||
append_path("{{ cmd.name }}", "{{ cmd.value }}", "{{ cmd.separator }}")
|
||||
{% elif command_name == 'RemovePath' %}
|
||||
{% elif command_name in ('RemovePath', 'RemoveFlagsEnv') %}
|
||||
remove_path("{{ cmd.name }}", "{{ cmd.value }}", "{{ cmd.separator }}")
|
||||
{% elif command_name == 'SetEnv' %}
|
||||
setenv("{{ cmd.name }}", "{{ cmd.value }}")
|
||||
|
@@ -43,9 +43,9 @@ conflict {{ name }}
|
||||
{% for command_name, cmd in environment_modifications %}
|
||||
{% if command_name == 'PrependPath' %}
|
||||
prepend-path --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}"
|
||||
{% elif command_name == 'AppendPath' %}
|
||||
{% elif command_name in ('AppendPath', 'AppendFlagsEnv') %}
|
||||
append-path --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}"
|
||||
{% elif command_name == 'RemovePath' %}
|
||||
{% elif command_name in ('RemovePath', 'RemoveFlagsEnv') %}
|
||||
remove-path --delim "{{ cmd.separator }}" {{ cmd.name }} "{{ cmd.value }}"
|
||||
{% elif command_name == 'SetEnv' %}
|
||||
setenv {{ cmd.name }} "{{ cmd.value }}"
|
||||
|
Reference in New Issue
Block a user