File: default-latest-version-specifiers.rst

package info (click to toggle)
modules 5.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,036 kB
  • sloc: exp: 79,659; sh: 6,142; tcl: 5,900; makefile: 1,492; ansic: 474; python: 265; csh: 202; perl: 47; ruby: 44; lisp: 13
file content (73 lines) | stat: -rw-r--r-- 3,390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
.. _default-latest-version-specifiers:

Default and latest version specifiers
=====================================

Configuration
-------------

- Rely on :mconfig:`advanced_version_spec` option

  - No need for an extra configuration option
  - When option is on it automatically enables use of these two new version specifiers
  - When ``advanced_version_spec`` is off, ``mod@latest`` is considered as a modulefile name to find
  - in case ``implicit_default`` is disabled

    - means a ``default`` symbol or a ``latest`` symbol should be found defined to respectively make use of the ``@default`` or ``@latest`` specifiers
    - a not found error is otherwise raised, as specified version does not exist


Specification
-------------

- When a ``default`` or a ``latest`` symbol is defined

  - ``@default`` or respectively ``@latest`` will resolve to the symbol target

- When no ``default`` or ``latest`` symbol is defined

  - ``@default`` and ``@latest`` point to the highest existing version (also called the implicit default)
  - note that if a ``default`` symbol is defined but not a ``latest`` symbol, ``@default`` points to the defined default and ``@latest`` points to the highest version that exists

- ``default`` or ``latest`` version specifiers can be employed:

  - in single version specification: ``@default`` or ``@latest``
  - in version list: ``@vers1,default`` or ``@latest,default,vers2``

- ``default`` or ``latest`` version specifiers cannot be employed in version range

  - otherwise an error is raised

- ``default`` or ``latest`` version specifiers can also be specified with the traditional ``mod/version`` syntax

  - for instance ``mod/default`` or ``mod/latest``

- When a ``default`` or ``latest`` modulefile exists

  - ``@default`` or respectively ``@latest`` will resolve to the existing modulefile
  - no automatic symbol will be recorded in this case as ``default`` or ``latest`` are regular versions

- To be included in module search result, the version specifiers should fully match search query or search query should not target a specific module version

  - the automatically defined symbolic versions are included in results for queries like ``mod@latest`` or ``mod``
  - but not for queries like ``mod@la``, ``mod@def``, ``mod@lat*``, ``mod@def??lt``

- Automatically defined ``default`` and ``latest`` version specifiers are not displayed to avoid overloading output:

  - on ``module list`` output
  - on ``module avail`` output
  - on ``module spider`` output
  - those three sub-commands only display symbolic versions manually defined

- Alternative module names deduced from the automatically defined version specifiers need to be tracked

  - in loaded environment for each targeted module loaded
  - to keep track loaded module is default or latest version
  - thus keeping ability to answer queries like ``is-loaded mod@latest`` from further modulefile evaluation or module command-line
  - this information is kept in the :envvar:`__MODULES_LMALTNAME` environment variable, along other alternative names
  - Auto symbols in this variable are recorded with a ``as|`` prefix to distinguish them from other alternative names

    - for instance ``mod/1.2&mod/regular_symbol&as|mod/latest``
    - it helps to filter auto symbols from regular symbols that need to be displayed

.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: