Skip to content

Commit 8ae1aa2

Browse files
committed
doc: adapt and extend path_entry_reorder doc
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent 420ea0b commit 8ae1aa2

7 files changed

Lines changed: 58 additions & 29 deletions

File tree

INSTALL.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,19 @@ instance :instopt:`--disable-set-manpath<--enable-set-manpath>`):
750750
.. versionchanged:: 5.6
751751
Enables automated *require via* mechanism
752752

753+
.. instopt:: --enable-path-entry-reorder
754+
755+
Change order of entry in a path-like environment variable, when
756+
:mfcmd:`prepend-path`, :mfcmd:`append-path` or :subcmd:`use` target a path
757+
entry that is already defined in the environment variable. (default=no)
758+
759+
This installation option defines the default value of the
760+
:mconfig:`path_entry_reorder` configuration option which could be changed
761+
after installation with the :subcmd:`config` sub-command.
762+
763+
.. only:: html or latex
764+
765+
.. versionadded:: 5.7
753766

754767
.. instopt:: --enable-quarantine-support
755768

Makefile.inc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ variantshortcut := @variantshortcut@
158158
# editor
159159
editor := @editor@
160160

161-
# Lmod path order
161+
# path change behavior
162162
pathentryreorder := @pathentryreorder@
163163

164164
# shell completion location

NEWS.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ Modules 5.7.0 (not yet released)
3838
environment variable on Fish shell version 4.3.
3939
* When fetching user's groups, in case a group name cannot be resolved use
4040
this group gid number as name instead of raising an error. (fix issue #604)
41+
* Introduce :mconfig:`path_entry_reorder` configuration option that change
42+
order of entry in a path-like environment variable when it is added again.
43+
This new configuration option is disabled by default. This option can be
44+
changed at installation time with :instopt:`--enable-path-entry-reorder`.
45+
When :mconfig:`path_entry_reorder` is changed with :subcmd:`config`
46+
sub-command, it sets the :envvar:`MODULES_PATH_ENTRY_REORDER` environment
47+
variable. (fix issue #595 with contribution from Achim Gsell)
4148

4249

4350
.. _5.6 release notes:

configure

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ Optional Features:
292292
--enable-require-via set modulecmd.tcl to consider that a module enabling
293293
a modulepath is a requirement for the loaded modules
294294
stored in this modulepath [no]
295+
--enable-path-entry-reorder
296+
change order of entry in a path-like environment
297+
variable when it is added again [no]
295298
--enable-implicit-requirement
296299
implicitly define a requirement toward modules
297300
specified on ``module load`` or ``module unload``

doc/source/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,8 @@ The following environment variables appeared on Modules 5.
10711071
| | :envvar:`__MODULES_LMUSE`, |
10721072
| | :envvar:`MODULES_REQUIRE_VIA` |
10731073
+------------+-----------------------------------------------------------------+
1074+
| 5.7 | :envvar:`MODULES_PATH_ENTRY_REORDER` |
1075+
+------------+-----------------------------------------------------------------+
10741076

10751077
Modules Specific Tcl Commands
10761078
"""""""""""""""""""""""""""""

doc/source/module.rst

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,8 +1373,8 @@ Module Sub-Commands
13731373
.. mconfig:: path_entry_reorder
13741374

13751375
Change order of entry in a path-like environment variable, when
1376-
:mfcmd:`prepend-path`, :mfcmd:`append-path` or :subcmd:`use` target
1377-
a path entry that is already defined in the environment variable.
1376+
:mfcmd:`prepend-path`, :mfcmd:`append-path` or :subcmd:`use` target a path
1377+
entry that is already defined in the environment variable.
13781378

13791379
Default value is ``0``. It can be changed at installation time with the
13801380
:instopt:`--enable-path-entry-reorder` option. The
@@ -1383,7 +1383,7 @@ Module Sub-Commands
13831383
its default value. See :envvar:`MODULES_PATH_ENTRY_REORDER` description
13841384
for details.
13851385

1386-
.. only:: html
1386+
.. only:: html or latex
13871387

13881388
.. versionadded:: 5.7
13891389

@@ -5293,30 +5293,33 @@ ENVIRONMENT
52935293

52945294
.. envvar:: MODULES_PATH_ENTRY_REORDER
52955295

5296-
This environment variable changes the behavior of :mfcmd:`prepend-path`, :mfcmd:`append-path` and :subcmd:`use`.
5296+
This environment variable changes the behavior of :mfcmd:`prepend-path`,
5297+
:mfcmd:`append-path` and :mfcmd:`module use<module>` modulefile commands and
5298+
sub-commands.
52975299

5298-
If set to ``1``, and one of these commands targets a path entry that already exists in the environment variable, the entry is moved to the beginning or end (depending on the command), unless duplicates are allowed. This is the default behavior in Lmod.
5299-
If set to ``0``, the environment variable is not modified when the entry already exists.
5300-
5301-
Example:
5302-
5303-
.. parsed-literal::
5304-
5305-
:ps:`$` module config path_entry_reorder 0
5306-
:ps:`$` module append-path PATHVAR /foo
5307-
:ps:`$` module append-path PATHVAR /bar
5308-
:ps:`$` module append-path PATHVAR /foo
5309-
:ps:`$` echo $PATHVAR
5310-
/foo:/bar
5311-
:ps:`$` module config path_entry_reorder 1
5312-
:ps:`$` module append-path PATHVAR /foo
5313-
:ps:`$` echo $PATHVAR
5314-
/bar:/foo
5315-
:ps:`$` module append-path --duplicates PATHVAR /bar
5316-
:ps:`$` echo $PATHVAR
5317-
/bar:/foo:/bar
5318-
5319-
.. only:: html
5300+
If set to ``1``, and one of these commands targets a path entry that already
5301+
exists in the environment variable, the entry is moved to the beginning or
5302+
end (depending on the command), unless duplicates are allowed. If set to
5303+
``0``, the environment variable is not modified when the entry already
5304+
exists.
5305+
5306+
.. parsed-literal::
5307+
5308+
:ps:`$` module config path_entry_reorder 0
5309+
:ps:`$` module append-path PATHVAR /foo
5310+
:ps:`$` module append-path PATHVAR /bar
5311+
:ps:`$` module append-path PATHVAR /foo
5312+
:ps:`$` echo $PATHVAR
5313+
/foo:/bar
5314+
:ps:`$` module config path_entry_reorder 1
5315+
:ps:`$` module append-path PATHVAR /foo
5316+
:ps:`$` echo $PATHVAR
5317+
/bar:/foo
5318+
:ps:`$` module append-path --duplicates PATHVAR /bar
5319+
:ps:`$` echo $PATHVAR
5320+
/bar:/foo:/bar
5321+
5322+
.. only:: html or latex
53205323

53215324
.. versionadded:: 5.7
53225325

doc/source/other-implementations.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ table highlights features that are unique to each implementation.
4343
* `i18n`_
4444
* `Find best module`_
4545
* `Path entry priorities`_
46-
* `Update path entry order`_
4746
* ``--regexp`` search option
4847
* `settarg`_
4948
* `Hook functions`_
@@ -158,6 +157,8 @@ implementation.
158157
- :ref:`Requiring via module`
159158
* - `Autoswap`_
160159
- :ref:`Conflict unload MIGRATING`
160+
* - `Update path entry order`_
161+
- :mconfig:`path_entry_reorder` configuration option
161162
* - |LMOD_DOWNSTREAM_CONFLICTS|_ environment variable
162163
- :ref:`Dependencies between modulefiles`
163164
* - |LMOD_QUARANTINE_VARS|_ environment variable
@@ -286,5 +287,5 @@ additional tools that enhance how modulefiles are handled.
286287
If you're aware of a ``module``-related project missing from this list, feel
287288
free to :ref:`contact us<Community>` so we can add it.
288289

289-
.. |modules_version| replace:: Modules 5.6.0
290+
.. |modules_version| replace:: Modules 5.7.0 (not yet released)
290291
.. |lmod_version| replace:: Lmod 9.0.5

0 commit comments

Comments
 (0)