Debian Codegraph @

doc/source/design/default-latest-version-specifiers.rst

raw
1 .. _default-latest-version-specifiers:
2
3 Default and latest version specifiers
4 =====================================
5
6 Configuration
7 -------------
8
9 - Rely on :mconfig:`advanced_version_spec` option
10
11 - No need for an extra configuration option
12 - When option is on it automatically enables use of these two new version specifiers
13 - When ``advanced_version_spec`` is off, ``mod@latest`` is considered as a modulefile name to find
14 - in case ``implicit_default`` is disabled
15
16 - means a ``default`` symbol or a ``latest`` symbol should be found defined to respectively make use of the ``@default`` or ``@latest`` specifiers
17 - a not found error is otherwise raised, as specified version does not exist
18
19
20 Specification
21 -------------
22
23 - When a ``default`` or a ``latest`` symbol is defined
24
25 - ``@default`` or respectively ``@latest`` will resolve to the symbol target
26
27 - When no ``default`` or ``latest`` symbol is defined
28
29 - ``@default`` and ``@latest`` point to the highest existing version (also called the implicit default)
30 - 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
31
32 - ``default`` or ``latest`` version specifiers can be employed:
33
34 - in single version specification: ``@default`` or ``@latest``
35 - in version list: ``@vers1,default`` or ``@latest,default,vers2``
36
37 - ``default`` or ``latest`` version specifiers cannot be employed in version range
38
39 - otherwise an error is raised
40
41 - ``default`` or ``latest`` version specifiers can also be specified with the traditional ``mod/version`` syntax
42
43 - for instance ``mod/default`` or ``mod/latest``
44
45 - When a ``default`` or ``latest`` modulefile exists
46
47 - ``@default`` or respectively ``@latest`` will resolve to the existing modulefile
48 - no automatic symbol will be recorded in this case as ``default`` or ``latest`` are regular versions
49
50 - 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
51
52 - the automatically defined symbolic versions are included in results for queries like ``mod@latest`` or ``mod``
53 - but not for queries like ``mod@la``, ``mod@def``, ``mod@lat*``, ``mod@def??lt``
54
55 - Automatically defined ``default`` and ``latest`` version specifiers are not displayed to avoid overloading output:
56
57 - on ``module list`` output
58 - on ``module avail`` output
59 - on ``module spider`` output
60 - those three sub-commands only display symbolic versions manually defined
61
62 - Alternative module names deduced from the automatically defined version specifiers need to be tracked
63
64 - in loaded environment for each targeted module loaded
65 - to keep track loaded module is default or latest version
66 - thus keeping ability to answer queries like ``is-loaded mod@latest`` from further modulefile evaluation or module command-line
67 - this information is kept in the :envvar:`__MODULES_LMALTNAME` environment variable, along other alternative names
68 - Auto symbols in this variable are recorded with a ``as|`` prefix to distinguish them from other alternative names
69
70 - for instance ``mod/1.2&mod/regular_symbol&as|mod/latest``
71 - it helps to filter auto symbols from regular symbols that need to be displayed
72
73 .. vim:set tabstop=2 shiftwidth=2 expandtab autoindent: