Skip to content

Commit 91b1c21

Browse files
committed
doc: also consider "-" as version number separator char
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent d0e9029 commit 91b1c21

5 files changed

Lines changed: 26 additions & 10 deletions

File tree

NEWS.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ Modules 5.7.0 (not yet released)
108108
test suite run is aborted.
109109
* Correctly match loaded modules specified as requirement with a trailing
110110
``/`` character after module name. (fix issue #640)
111+
* Also consider ``-`` in addition to ``.`` as a version number separator
112+
character when selecting a module with the :mconfig:`extended_default`
113+
mechanism. (fix issue #619)
111114

112115

113116
.. _5.6 release notes:

doc/source/changes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,9 @@ Starting version 5.5, characters ``+`` and ``~`` may be part of module name or
764764
version as long as the string part next to these character is not a valid
765765
variant name.
766766

767+
Starting version 5.7, character ``-`` is considered a version number separator
768+
for :mconfig:`extended_default` mechanism.
769+
767770
Environment
768771
"""""""""""
769772

doc/source/design/extended-default.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ Specification
2525
- query soft/1 returns nothing
2626
- query soft/10.1.2 returns highest among soft/10.1.2.4 soft/10.1.2.3
2727

28-
- In situation where soft/1.1(default) soft/1.2 soft/2.1 soft/2.2
28+
- In situation where soft/1.1(default) soft/1.2 soft/2.1 soft/2.2 soft/3.4-ad75bc9a
2929

3030
- query soft/1 returns soft/1.1
3131
- query soft/2 returns soft/2.2
32+
- query soft/3.4 returns soft/3.4-ad75bc9a
3233

33-
- Character considered as version number separator: ``.``
34+
- Characters considered as version number separator: ``.`` and ``-``
3435

3536
- list: ``.`` and ``-``
36-
- ``-`` was also considered initially, but cannot determine in all case the highest version specified after this character (may find a hash name, strings like *rc*, *alpha*, *beta*, etc)
37+
- ``-`` is considered a version number separator character since version 5.7
3738
- not possible with ``+`` as it is used by variant specification
3839

3940
- Does not apply to the root part of module name

doc/source/module.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,8 +3146,9 @@ Constraints can be expressed to refine the selection of module version to:
31463146
Advanced specification of single version or list of versions may benefit from
31473147
the activation of the extended default mechanism (see
31483148
:envvar:`MODULES_EXTENDED_DEFAULT`) to use an abbreviated notation like ``@1``
3149-
to refer to more precise version numbers like ``1.2.3``. Range of versions on
3150-
its side natively handles abbreviated versions.
3149+
to refer to more precise version numbers like ``1.2.3``. Characters ``.`` and
3150+
``-`` are considered version number separator to determine abbreviated
3151+
versions. Range of versions on its side natively handles abbreviated versions.
31513152

31523153
In order to be specified in a range of versions or compared to a range of
31533154
versions, the version major element should corresponds to a number. For
@@ -5008,9 +5009,9 @@ ENVIRONMENT
50085009

50095010
If set to ``1``, a specified module version is matched against starting
50105011
portion of existing module versions, where portion is a substring separated
5011-
from the rest of the version string by a ``.`` character. For example
5012+
from the rest of the version string by ``.`` or ``-`` characters. For example
50125013
specified modules ``mod/1`` and ``mod/1.2`` will match existing modulefile
5013-
``mod/1.2.3``.
5014+
``mod/1.2.3`` and ``mod/2.4`` will match ``mod/2.4-91db5cf2``.
50145015

50155016
In case multiple modulefiles match the specified module version and a single
50165017
module has to be selected, the explicitly set default version is returned if
@@ -5026,6 +5027,9 @@ ENVIRONMENT
50265027

50275028
.. versionadded:: 4.4
50285029

5030+
.. versionchanged:: 5.7
5031+
Character ``-`` is also considered a version number separator
5032+
50295033
.. envvar:: MODULES_FAMILY_<NAME>
50305034

50315035
Module name minus version that provides for the *name* family in currently

doc/source/modulefile.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,8 +1949,8 @@ The equivalent :file:`.modulerc` would look like:
19491949
If the extended default mechanism is enabled (see
19501950
:envvar:`MODULES_EXTENDED_DEFAULT` in :ref:`module(1)`) the module version
19511951
specified is matched against starting portion of existing module versions,
1952-
where portion is a substring separated from the rest of version string by a
1953-
``.`` character.
1952+
where portion is a substring separated from the rest of version string by
1953+
``.`` or ``-`` characters.
19541954

19551955
When the implicit default mechanism and the `Advanced module version
19561956
specifiers`_ are both enabled, a ``default`` and ``latest`` symbolic versions
@@ -2081,7 +2081,9 @@ Advanced specification of single version or list of versions may benefit from
20812081
the activation of the extended default mechanism (see
20822082
:envvar:`MODULES_EXTENDED_DEFAULT` in :ref:`module(1)`) to use an abbreviated
20832083
notation like ``@1`` to refer to more precise version numbers like ``1.2.3``.
2084-
Range of versions on its side natively handles abbreviated versions.
2084+
Characters ``.`` and ``-`` are considered version number separator to
2085+
determine abbreviated versions. Range of versions on its side natively handles
2086+
abbreviated versions.
20852087

20862088
In order to be specified in a range of versions or compared to a range of
20872089
versions, the version major element should corresponds to a number. For
@@ -2109,6 +2111,9 @@ version will be selected.
21092111
.. versionchanged:: 4.8
21102112
Use of version range is allowed in version list
21112113

2114+
.. versionchanged:: 5.7
2115+
Character ``-`` is also considered a version number separator
2116+
21122117
Variants
21132118
^^^^^^^^
21142119

0 commit comments

Comments
 (0)