Enforce use of the module magic cookie (i.e., `#%Module`) at the start of
global or user rc files, `initrc` configuration file or any scriptfile
passed for evaluation to the `source` sub-command. These files are not
evaluated and an error is produced if the magic cookie is missing or if
the optional version number placed after the cookie string is higher than
the version of the `modulecmd.tcl` script in use.
Note that version 3.2 of Modules was already enforcing the magic cookie
for the user/global rc files.
This enforced back globally to ensure people understand, especially for
the source sub-command, that the script is made for module and it is not
a shell script. It will also help to protect module from automatically
evaluating files with expected file name but unrelated content.
This commit among things reverts 3fe71c0d.
No error is raised when evaluating in `display` mode a modulefile without
a value specified for the variant it defines. This change helps to learn
all the variant a modulefile defines. As a result, the unspecified
variant is not instantiated in the ModuleVariant array variable.
Fixes#406.
Fix unuse sub-command when sereval modulepaths are specified as a single
argument (i.e., `/path/to/dir1:/path/to/dir2`). Enabled modulepaths were
not correctly detected when specified this way.
Allow non-existent directory to be specified to use sub-command so
directory that does not exist yet could be added to MODULEPATH prior
being created.
Also it may allow a shared module configuration to define all existing
paths across the network but only some of these paths are enabled on a
given host.
Add description to the diff doc to get the behavior of Modules v3 back
when using `module load` command in modulefile. To pursue evaluation
even when the `module load` fails, enclose it within a `catch` Tcl
command.
Fixes#197.
When an optional requirement is loaded by not specifying its variant
value to rely on default, the Dependent Reload mechanism will miss to
detect the dependent module to reload, as variant is not specified on
command line thus it does not match the requirement specification prior
load.