Default and latest version specifiers¶
Configuration¶
- Rely on
advanced_version_specoption- No need for an extra configuration option
- When option is on it automatically enables use of these two new version specifiers
- When
advanced_version_specis off,mod@latestis considered as a modulefile name to find - in case
implicit_defaultis disabled- means a
defaultsymbol or alatestsymbol should be found defined to respectively make use of the@defaultor@latestspecifiers - a not found error is otherwise raised, as specified version does not exist
- means a
Specification¶
- When a
defaultor alatestsymbol is defined@defaultor respectively@latestwill resolve to the symbol target
- When no
defaultorlatestsymbol is defined@defaultand@latestpoint to the highest existing version (also called the implicit default)- note that if a
defaultsymbol is defined but not alatestsymbol,@defaultpoints to the defined default and@latestpoints to the highest version that exists
defaultorlatestversion specifiers can be employed:- in single version specification:
@defaultor@latest - in version list:
@vers1,defaultor@latest,default,vers2
- in single version specification:
defaultorlatestversion specifiers cannot be employed in version range- otherwise an error is raised
defaultorlatestversion specifiers can also be specified with the traditionalmod/versionsyntax- for instance
mod/defaultormod/latest
- for instance
- When a
defaultorlatestmodulefile exists@defaultor respectively@latestwill resolve to the existing modulefile- no automatic symbol will be recorded in this case as
defaultorlatestare 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@latestormod - but not for queries like
mod@la,mod@def,mod@lat*,mod@def??lt
- the automatically defined symbolic versions are included in results for queries like
- Automatically defined
defaultandlatestversion specifiers are not displayed to avoid overloading output:- on
module listoutput - on
module availoutput - those two sub-commands only display symbolic versions manually defined
- on
- 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@latestfrom further modulefile evaluation or module command-line - this information is kept in the
__MODULES_LMALTNAMEenvironment 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
- for instance