Skip to content

Commit 2e28703

Browse files
committed
doc: desc. haveDynamicMPATH modulefile command
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent d95e229 commit 2e28703

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

NEWS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Modules 5.6.0 (not yet released)
151151
* Add :subcmd:`disable` sub-command, an alias of :subcmd:`saverm`
152152
* Add :subcmd:`describe` sub-command, an alias of :subcmd:`saveshow`
153153
* Add ``--show_hidden`` option, an alias of :option:`--all`
154+
* Add :mfcmd:`haveDynamicMPATH` modulefile command
154155

155156
.. _Security policy: https://github.com/envmodules/modules/blob/main/SECURITY.md
156157
.. _Modules chat room: https://matrix.to/#/#modules:matrix.org

doc/source/changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ The following modulefile Tcl commands appeared on Modules 5.
10921092
| | :mfcmd:`lsb-release` |
10931093
+------------+-----------------------------------------------------------------+
10941094
| 5.6 | :mfcmd:`depends-on-any`, :mfcmd:`module-help`, |
1095-
| | :mfcmd:`module-warn` |
1095+
| | :mfcmd:`module-warn`, :mfcmd:`haveDynamicMPATH` |
10961096
+------------+-----------------------------------------------------------------+
10971097

10981098
:mfcmd:`system`, :mfcmd:`is-used`

doc/source/modulefile.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,21 @@ the *modulefile* is being loaded.
351351
Option ``--return-value`` added.
352352

353353

354+
.. mfcmd:: haveDynamicMPATH
355+
356+
:mfcmd:`haveDynamicMPATH` command signals that a modulefile modifies the
357+
:envvar:`MODULEPATH` environment variable. It is useful when the modulefile
358+
conditionally updates :envvar:`MODULEPATH` and is processed by Lmod tool.
359+
360+
Here in the Modules tool, this command is implemented as a *no-operation*,
361+
since the :subcmd:`spider` sub-command evaluates the modulefile in the
362+
context of the current user to determine whether :envvar:`MODULEPATH` is
363+
updated.
364+
365+
.. only:: html
366+
367+
.. versionadded:: 5.6
368+
354369
.. mfcmd:: hide-modulefile modulefile
355370

356371
Alias of :mfcmd:`module-hide` command.
@@ -2195,6 +2210,13 @@ The ``remove-property`` and ``extensions`` modulefile commands are evaluated
21952210
as a *no-operation* command. No error is obtained if these commands are used
21962211
in modulefiles but no change occurs.
21972212

2213+
The :mfcmd:`haveDynamicMPATH` is evaluated as a *no-operation* modulefile
2214+
command. If modulefile conditionally updates :envvar:`MODULEPATH` environment
2215+
variable, this command is needed to help Lmod know that modulefile changes
2216+
:envvar:`MODULEPATH`. :subcmd:`spider` sub-command on Modules does not need
2217+
this information as modulefile is evaluated in the context of the current
2218+
user to determine whether :envvar:`MODULEPATH` is updated.
2219+
21982220
The :mfcmd:`break` command does not accept any argument. A ``msg`` argument
21992221
can be set on Lmod to provide a customized break error message.
22002222

@@ -2256,7 +2278,8 @@ the dependent module will get automatically reloaded.
22562278
.. versionadded:: 5.1
22572279

22582280
.. versionchanged:: 5.6
2259-
Modulefile command :mfcmd:`add-property` implemented
2281+
Modulefile commands :mfcmd:`add-property` and :mfcmd:`haveDynamicMPATH`
2282+
implemented
22602283

22612284
.. _Shell support:
22622285

doc/source/other-implementations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ the end of this section to map these equivalents.
114114

115115
* - Lmod 8.8
116116
- Modules 5.6
117-
* - ``extensions``, ``haveDynamicMPATH``, ``remove-property``
117+
* - ``extensions``, ``remove-property``
118118
- :mfcmd:`getvariant`, :mfcmd:`is-saved`, :mfcmd:`is-used`,
119119
:mfcmd:`lsb-release`, :mfcmd:`module-help`, :mfcmd:`module-tag`,
120120
:mfcmd:`module-virtual`, :mfcmd:`module-warn`,

0 commit comments

Comments
 (0)