Skip to content

Commit 0d4f634

Browse files
bugfix for conflict() in modulefile templates 4x (#485)
* bugfix for conflict() in modulefile templates 4x * modulefile template conflicts: name, too, if different from tool * module template conflicts: minor changes to improve clarity
1 parent 1b269e4 commit 0d4f634

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

shpc/main/modules/templates/docker.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For each of the above, you can export:
4040
if not os.getenv("PODMAN_OPTS") then setenv ("PODMAN_OPTS", "") end
4141
if not os.getenv("PODMAN_COMMAND_OPTS") then setenv ("PODMAN_COMMAND_OPTS", "") end
4242

43-
-- we probably don't need this
43+
-- we probably do not need this
4444
local MODULEPATH="{{ module_dir }}"
4545

4646
-- interactive shell to any container, plus exec for aliases
@@ -56,7 +56,7 @@ local inspectCmd = "{{ command }} ${PODMAN_OPTS} inspect ${PODMAN_COMMAND_OPTS}
5656
set_shell_function("{|module_name|}-shell", shellCmd, shellCmd)
5757

5858
-- conflict with modules with the same name
59-
conflict(myModuleName(){% if aliases %}{% for alias in aliases %}{% if alias.name != name %},"{{ alias.name }}"{% endif %}{% endfor %}{% endif %})
59+
conflict("{{ tool }}"{% if name != tool %},"{{ name }}"{% endif %}{% if aliases %}{% for alias in aliases %}{% if alias.name != tool %},"{{ alias.name }}"{% endif %}{% endfor %}{% endif %})
6060

6161
-- exec functions to provide "alias" to module commands
6262
{% if aliases %}{% for alias in aliases %}

shpc/main/modules/templates/docker.tcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ set helpcommand "This module is a {{ docker }} container wrapper for {{ name }}
5555
{% endfor %}{% endif %}
5656

5757
# conflict with modules with the same alias name
58-
conflict {{ name }}
59-
{% if aliases %}{% for alias in aliases %}{% if alias.name != name %}conflict {{ alias.name }}{% endif %}
58+
conflict {{ tool }}
59+
{% if name != tool %}conflict {{ name }}{% endif %}
60+
{% if aliases %}{% for alias in aliases %}{% if alias.name != tool %}conflict {{ alias.name }}{% endif %}
6061
{% endfor %}{% endif %}
6162

6263
# interactive shell to any container, plus exec for aliases

shpc/main/modules/templates/singularity.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ For each of the above, you can export:
3838

3939
{% if singularity_module %}load("{{ singularity_module }}"){% endif %}
4040

41-
-- we probably don't need this
41+
-- we probably do not need this
4242
local MODULEPATH="{{ module_dir }}"
4343

4444
-- singularity environment variable to set shell
@@ -59,7 +59,7 @@ local inspectCmd = "singularity ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAN
5959
set_shell_function("{|module_name|}-shell", shellCmd, shellCmd)
6060

6161
-- conflict with modules with the same name
62-
conflict(myModuleName(){% if aliases %}{% for alias in aliases %}{% if alias.name != name %},"{{ alias.name }}"{% endif %}{% endfor %}{% endif %})
62+
conflict("{{ tool }}"{% if name != tool %},"{{ name }}"{% endif %}{% if aliases %}{% for alias in aliases %}{% if alias.name != tool %},"{{ alias.name }}"{% endif %}{% endfor %}{% endif %})
6363

6464
-- exec functions to provide "alias" to module commands
6565
{% if aliases %}{% for alias in aliases %}

shpc/main/modules/templates/singularity.tcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ set helpcommand "This module is a singularity container wrapper for {{ name }} v
6161
{% endfor %}{% endif %}
6262

6363
# conflict with modules with the same alias name
64-
conflict {{ name }}
65-
{% if aliases %}{% for alias in aliases %}{% if alias != name %}conflict {{ alias.name }}{% endif %}
64+
conflict {{ tool }}
65+
{% if name != tool %}conflict {{ name }}{% endif %}
66+
{% if aliases %}{% for alias in aliases %}{% if alias.name != tool %}conflict {{ alias.name }}{% endif %}
6667
{% endfor %}{% endif %}
6768

6869
# singularity environment variable to set shell

0 commit comments

Comments
 (0)