Register alias and symbolic version deep resolution at definition time
through a new 'setModuleResolution' procedure called by 'module-version'
and 'module-alias' procedures. Make use of new global array
'g_moduleResolved' and its reverse structure 'g_resolvedHash' to keep
registered resolution at hand. Also introduce 'g_symbolHash' global
array to register and easily get the list of all symbols for a given
module.
As resolution is now computed at definition time, the 'getVersAliasList'
and 'resolveModuleVersionOrAlias' procedures can be greatly simplified
and just need to return the value of the 'g_symbolHash' or
'g_moduleResolved' arrays for the module name passed as argument. This
change saves lot of time especially on commands heavily relying on these
procedures like 'avail'.
The global arrays 'g_versionHash', 'g_moduleDefault' and 'g_aliasHash'
become useless with this change so they have been removed.
As a side effect of resolving alias and symbolic version at definition
time, resolution loop are not registered anymore and produce an error
message when spotted.
Adapt tests from 60-initx to match results produced by this module
flavor. Clarify differences with C-version on these module commands in
diff_with_c-version documentation.
Add 'module test' command to trigger when called execution of a
ModulesTest procedure in target modulefile following same kind of
mechanism than 'module help'.
If ModulesTest procedure is missing from modulefile, a 'Unable to find
ModulesTest proc' message is displayed but no error code is set. If
ModulesTest procedure returns 1 (true), test is considered successful and
message 'Test result: PASS' is displayed. If ModulesTest returns no or
any other value, test is considered failed and message 'Test result:
FAIL' is displayed. In this case, module command exit in error.
Adapt bash and tcsh completion scripts for the new command. Describe new
command and new mode in docs.
Adapt existing non-regression tests and relative test modulefiles for
new command and new mode in 00-init, 50-cmds and 70-maint suites. Add
085-test tests in 70-maint to check coherent behavior of new command.
Improve diff_with_c-version document to describe the features of the
Tcl-version that are not supported on the C-version.
Also state that the diff takes C version 3.2.10 against Tcl version
1.729 as a basis. Differences appearing past these versions will be
flagged with the release number of appearance.
Use same process than init scripts to translate module documentation
from configure-like pattern (@prefix@, @initdir@, etc) to the path name
chosen for installation.
Adapt module.pod and modulefile.pod to use itemized-list rather than
head2 for the content of their ENVIRONMENT and FILES sections. HTML
rendering is clearer with a list than h2.
For compatibility with C-version, enable to check current 'module-info
mode' against the 'remove' and 'switch' value. To achieve this change
'remove' is considered an alias of the 'unload' value. 'switch' is
checked against the current 'module-info command'.
084-info-mode-exp tests of 50-cmds suite have been adapted. In addition
020-unload and 022-unload2 tests of 95-version suite have also been
adapted as the modulefiles they check are using a 'module-info mode
remove' test.
Introduce g_commandNameStack variable, currentCommandName,
pushCommandName and popCommandName procedures to implement a
'module-info command' that returns the name of the currently running
module command.
This new mechanism enables to distinguish complex 'load' or 'unload'
commands that cannot be determined with 'module-info mode' alone. For
instance a modulefile can now be aware that a 'switch', a 'restore' or
a 'purge' command is currently being run.
Add description of this new command to the modulefile documentation.
Add 282-info-command and 283-info-command-exp tests in 50-cmds and adapt
281-info-modulerc in 50-cmds and 020-savelist in 61-coll.
Add the possibility to pass a string to 'module-info shell' and
'module-info shelltype' to get a boolean test on currently used shell or
shelltype. This kind of behavior is already available on 'module-info
mode' to test module current mode.
These features are supported by C-version even if not documented.
modulefile documentation and 087-info-shells-exp tests in 50-cmds suite
have been adapted accordingly.
Adopt and apply writing conventions found especially in man-manpages(7)
to improve documents readability:
* always refer to 'modulefile' or 'modulefiles' with I<> pod code
* refer to other manpages with B<> pod code
* refer to filename or pathname with F<> pod code
* refer to environment variable with B<> pod code
* no '$' before environment variable except if its value is referred
* no escaping '{}' of environment variable
* use item list to describe ordered list
* use item list to describe all command-line switches, all module
sub-commands and all modules-specific Tcl commands
* refer to command-line switches, module sub-commands, modules-specific
Tcl commands, Modules variables and Modules subroutines with B<> pod
code
* use normal font for arguments on item list
* refer to arguments of current command-line switch, module sub-command
or modules-specific Tcl command with I<> pod code
* express 1+ arguments with a 'arg...' syntax
* format pod source with 'fmt' to set maximum line witdh to 78 chars
* fix double spaces ' ' or end of line extra space found in paragraphs
This is still a work in progress, but I've converted the current
man pages over to pod (perl documentation format)
The idea being that it's easier to edit and can be converted to
various formats. The manpages are very out of date, but this at least
will encourage me to keep them upto date and make it much easier to
work with.