diff --git a/NEWS.rst b/NEWS.rst index 728dda9b..7c52fba2 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -151,6 +151,7 @@ Modules 5.6.0 (not yet released) * Add :subcmd:`disable` sub-command, an alias of :subcmd:`saverm` * Add :subcmd:`describe` sub-command, an alias of :subcmd:`saveshow` * Add ``--show_hidden`` option, an alias of :option:`--all` +* Add :mfcmd:`haveDynamicMPATH` modulefile command .. _Security policy: https://github.com/envmodules/modules/blob/main/SECURITY.md .. _Modules chat room: https://matrix.to/#/#modules:matrix.org diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 24416d90..244e3cfe 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -1092,7 +1092,7 @@ The following modulefile Tcl commands appeared on Modules 5. | | :mfcmd:`lsb-release` | +------------+-----------------------------------------------------------------+ | 5.6 | :mfcmd:`depends-on-any`, :mfcmd:`module-help`, | -| | :mfcmd:`module-warn` | +| | :mfcmd:`module-warn`, :mfcmd:`haveDynamicMPATH` | +------------+-----------------------------------------------------------------+ :mfcmd:`system`, :mfcmd:`is-used` diff --git a/doc/source/modulefile.rst b/doc/source/modulefile.rst index b04b8890..117a5fe1 100644 --- a/doc/source/modulefile.rst +++ b/doc/source/modulefile.rst @@ -351,6 +351,21 @@ the *modulefile* is being loaded. Option ``--return-value`` added. +.. mfcmd:: haveDynamicMPATH + + :mfcmd:`haveDynamicMPATH` command signals that a modulefile modifies the + :envvar:`MODULEPATH` environment variable. It is useful when the modulefile + conditionally updates :envvar:`MODULEPATH` and is processed by Lmod tool. + + Here in the Modules tool, this command is implemented as a *no-operation*, + since the :subcmd:`spider` sub-command evaluates the modulefile in the + context of the current user to determine whether :envvar:`MODULEPATH` is + updated. + + .. only:: html + + .. versionadded:: 5.6 + .. mfcmd:: hide-modulefile modulefile Alias of :mfcmd:`module-hide` command. @@ -2195,6 +2210,13 @@ The ``remove-property`` and ``extensions`` modulefile commands are evaluated as a *no-operation* command. No error is obtained if these commands are used in modulefiles but no change occurs. +The :mfcmd:`haveDynamicMPATH` is evaluated as a *no-operation* modulefile +command. If modulefile conditionally updates :envvar:`MODULEPATH` environment +variable, this command is needed to help Lmod know that modulefile changes +:envvar:`MODULEPATH`. :subcmd:`spider` sub-command on Modules does not need +this information as modulefile is evaluated in the context of the current +user to determine whether :envvar:`MODULEPATH` is updated. + The :mfcmd:`break` command does not accept any argument. A ``msg`` argument can be set on Lmod to provide a customized break error message. @@ -2256,7 +2278,8 @@ the dependent module will get automatically reloaded. .. versionadded:: 5.1 .. versionchanged:: 5.6 - Modulefile command :mfcmd:`add-property` implemented + Modulefile commands :mfcmd:`add-property` and :mfcmd:`haveDynamicMPATH` + implemented .. _Shell support: diff --git a/doc/source/other-implementations.rst b/doc/source/other-implementations.rst index ac4fbfa4..13dc9c72 100644 --- a/doc/source/other-implementations.rst +++ b/doc/source/other-implementations.rst @@ -114,7 +114,7 @@ the end of this section to map these equivalents. * - Lmod 8.8 - Modules 5.6 - * - ``extensions``, ``haveDynamicMPATH``, ``remove-property`` + * - ``extensions``, ``remove-property`` - :mfcmd:`getvariant`, :mfcmd:`is-saved`, :mfcmd:`is-used`, :mfcmd:`lsb-release`, :mfcmd:`module-help`, :mfcmd:`module-tag`, :mfcmd:`module-virtual`, :mfcmd:`module-warn`,