From 8973b370433ef2642cd69e57f2e52fc6db578e8a Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sat, 13 Jan 2018 15:34:51 +0100 Subject: [PATCH] doc: desc. module-virtual command --- NEWS.rst | 8 ++++++++ doc/source/diff_v3_v4.rst | 2 ++ doc/source/modulefile.rst | 21 +++++++++++++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/NEWS.rst b/NEWS.rst index cfbdd4fb..9d576e5c 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -131,6 +131,14 @@ Modules 4.1.0 (2018-01-??) executes the active module command. * Fix modulefile Tcl interpreter reset when handling list variables. (fix issue#145) +* Introduce 'module-virtual' modulefile Tcl command to associate a virtual + module name to a modulefile. This module can be located with its virtual + name and the associated modulefile is the script interpreted when loading, + unloading, etc. +* Resolution of relative paths occurring during a modulefile interpretation to + target a modulefile or a modulepath now takes the directory of the currently + interpreted modulefile as the current working directory to solve the + relative paths. Modules 4.0.0 (2017-10-16) diff --git a/doc/source/diff_v3_v4.rst b/doc/source/diff_v3_v4.rst index 020d4673..ddc7ebdc 100644 --- a/doc/source/diff_v3_v4.rst +++ b/doc/source/diff_v3_v4.rst @@ -408,4 +408,6 @@ Modules Specific Tcl Commands **is-avail** +**module-virtual** + These Modules-specific Tcl commands appeared on version ``4.1`` and are not supported on compatibility version. diff --git a/doc/source/modulefile.rst b/doc/source/modulefile.rst index 8d532ced..273d15ba 100644 --- a/doc/source/modulefile.rst +++ b/doc/source/modulefile.rst @@ -376,6 +376,18 @@ the *modulefile* is being loaded. * another *modulefile* alias +**module-virtual** name modulefile + + Assigns the *modulefile* to the virtual module *name*. This command should be + placed in rc files in order to define virtual modules. + + A virtual module stands for a module *name* associated to a *modulefile*. The + modulefile is the script interpreted when loading or unloading the virtual + module which appears or can be found with its virtual name. + + The parameter *modulefile* corresponds to the relative or absolute file + location of a *modulefile*. + **module-whatis** string Defines a string which is displayed in case of the invocation of the @@ -475,7 +487,8 @@ is actually a directory, the directory is opened and a search begins for an actual *modulefile*. First, **modulecmd.tcl** looks for a file with the name *.modulerc* in the directory. If this file exists, its contents will be evaluated as if it was a *modulefile* to be loaded. You may place -**module-version** and **module-alias** commands inside this file. +**module-version**, **module-alias** and **module-virtual** commands inside +this file. Additionally, before seeking for *.modulerc* files in the module directory, the global modulerc file is sourced, too. If a named version default now @@ -499,9 +512,9 @@ difference is that *.version* only applies to the current directory, and the made in these files will affect the subsequently interpreted *modulefile*. If no default version may be figured out, then the highest numerically -sorted *modulefile* or module alias under the directory will be used. The -dictionary comparison method of the **lsort**\ (n) Tcl command is used -to achieve this sort. If highest numerically sorted element is an alias, +sorted *modulefile*, virtual module or module alias under the directory will +be used. The dictionary comparison method of the **lsort**\ (n) Tcl command is +used to achieve this sort. If highest numerically sorted element is an alias, search continues on its *modulefile* target. For example, it is possible for a user to have a directory named X11 which