Commit Graph

10 Commits

Author SHA1 Message Date
Xavier Delaruelle
9bcd974337 ts: existing tests now accept {ap,pre}pend-path delim char 2024-01-29 07:23:16 +01:00
Xavier Delaruelle
bce94b1929 ts: fix NonExistent typo in several tests
Fixes #439
2022-02-17 08:21:54 +01:00
Xavier Delaruelle
e43876bcea Report error when empty name passed to getPathToModule
Triggered with 'module load ""' call in modulefile. Helps to know what
is going on.
2018-03-16 07:04:10 +01:00
Xavier Delaruelle
7c0e21bc95 Cwd during interp corresponds to modfile dir
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.
2018-01-13 14:04:35 +01:00
Xavier Delaruelle
b88651f570 Failed load/unload if submod load/unload fails
When a modulefile loads or unloads another modulefile, load or unload
issue did not previously led to upper module load or unload failure. As
a result, the upper modulefile appeared loaded or unloaded whereas its
dependent sub-modulefile were not loaded or respectively still loaded.

This commit makes cmdModuleLoad and cmdModuleUnload procedure return an
exit code to let know if load or unload action performed correctly. In
case of a 'module load' or 'module unload' call within a modulefile, the
module procedure will raise an error with the dummy message
'SUB_FAILED'. This message is caught at the result of the modulefile
interpretation to return an error code, without raising error count or
message as it has already been handled at the root of the issue.
2017-09-04 09:17:25 +02:00
Xavier Delaruelle
94e3fe08ec testsuite: add test modfiles that should be hidden
Ensure modulefiles starting with a dot or finishing with a tilde are not
reported in global 'module avail' results.
2017-05-24 07:18:04 +02:00
Xavier Delaruelle
3b3880054c Reverse load command mod list on unload mode
When mode is set to unload, 'module load' commands in modulefile are
interpreted as 'module unload' commands. To guaranty correct behavior
regarding requirements, the module list passed to the load command is
reversed to get and unload of the modulefiles in the reverse order than
load.

This is the same behavior than applied on purge or restore commands,
where loaded module list is reversed to be unloaded.

Add non-regression tests in 150-module of 50-cmds suite to check load
and unload of meta-module works correctly over time.
2017-04-17 21:30:12 +02:00
Kent Mein
bd4a515a7d Moved things out of the tcl directory.
Kent
2013-01-10 15:48:30 -06:00
Kent Mein
76adb1c7e3 Removed all of the non tcl version stuff. Or most of it anyway.
Kent
2013-01-10 15:44:49 -06:00
rk
e816ab15b5 modules is a shell tool for setting-up the user environment on the
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.
2000-06-28 00:17:34 +00:00