And make it a repository for additional test modulefiles that do not
need to take part in the global avail tests made over the main
repository (modulefiles) and who could mixed with others (like other and
other2).
Improve getModulePathList procedure to pass each directory element part
of the MODULEPATH env variable through getAbsolutePath. Ensure this way
each directory has correct form to work with afterward.
A 'set_abs' argument is added to getModulePathList procedure, enabled by
default, to apply this new cleanup behavior. Not applied for
cmdModuleUse and cmdModuleUnuse who will need extra work to detect
relative/full paths already set in MODULEPATH.
Add bunch of tests to check the various commands when modulepath
directory has trailing slash at its end.
Fixes#152
Now getAbsolutePath procedure, which make a path passed as argument an
absolute path, check the current path of the interpreted modulefile or
modulerc rather always taking the current path of the module command
execution.
So a modulefile or modulerc can use relative paths based on a
determistic way as it is now based on their location. Previously it was
not possible as relative paths were dependent of the location from where
the module command was executed.
If ModulesCurrentModulefile variable is not empty, getAbsolutePath nows
it is called during a modulefile/modulerc interpretation, so it takes
the directory name of this ModulesCurrentModulefile as current working
directory.
Add 'loaded' sub-command to the 'module-info' modulefile Tcl command.
This new sub-command returns name of the modules currently loaded
corresponding to the name passed as argument. May return multiple
modules if passed name matches more than one loaded modules.
Document new command in modulefile.4 and test it with a 285-info-loaded
tests in 50-cmds suite.
Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
Introduce 'is-avail' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed modulefiles exists in
enabled in MODULEPATH.
Document new command in modulefile.4 and test it with a 322-is-avail
tests in 50-cmds suite.
Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
Introduce 'is-used' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed directories has been
enabled in MODULEPATH.
Document new command in modulefile.4 and test it with a 321-is-used
tests in 50-cmds suite.
Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
Introduce 'is-saved' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed collections exists.
Document new command in modulefile.4 and test it with a 320-is-saved
tests in 50-cmds suite.
Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
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.
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.
Introduce g_specifiedNameStack variable, currentSpecifiedName,
pushSpecifiedName and popSpecifiedName procedures to implement a
'module-info specified' that returns the modulefile name as specified on
the command-line.
Add 280-info-specified tests to the 50-cmds suite.
Fix mode setup during a 'help' command and import info-mode relative
tests in 50-cmds suite.
module-info non-regression tests have been adapted to match behavior of
Tcl-version:
* during a 'help' command, stdout output of ModulesHelp procedure is not
redirected to stderr as done on C-version
* on an 'unload' command, module-info mode is equal to 'unload' and not
'remove'
* on a 'switch' command, module-info mode is equal to 'unload' then
'load' and not 'switch1', 'switch2' and 'switch3'
* on a 'switch' command, module-info mode never equals to 'switch'
'flags' and 'user' are C-version specific options and they are not
relevant for Tcl-version. So they are present on Tcl-version to avoid
breaking modulefile using them but always return false or an empty
string to reflect the fact that these options are unmanaged here.
Import and adapt info-user and info-flags non-regression tests in
50-cmds suite.
same path location as the old. Also added a number of tests
for this feature.
(Bug was pointed out by Leo Butler <lbutler@brocade.com>)
* Added tests for the "is-loaded" modulefile command introduced
back in 3.0.8-rko.
fly, as it were. It's a powerful mechanism for dynamically changing
environment variables, aliases, X11 resources, etc.
It uses an embedded Tcl intrepretor, with a few extensions. Therefore,
it has a well defined language syntax.
Version 3.1 is GPL, and includes many improvements over the 3.0beta.