Update execute-modulefile procedure to add requested argument. This
piece of information tells if the evaluation has been requested by user
or if it is an automatically triggered evaluation.
Internal evaluation (refresh, scan and whatis) are considered auto
evaluations.
Update "puts" command available during modulefile evaluation context to
be able to send text to the log system. Use "log" channel string to
direct text to the logging mechanism.
An event is effectively logged if it is defined in the logged_events
configuration option. The "all_eval" value matches both "req_eval" and
"all_eval" events.
Create logfd and logging states to manage respectively logger pipe file
descriptor and log enablement. Logging is disabled is logger command is
an empty string or if there is no message to log.
Logs are sent during the termination phase of the modulecmd process.
Logger pipe is started for the duration of the flush operation only.
Add logged_events configuration option that defines the kind of events
to log. Nothing is logged by default. When configuration is modified it
sets the MODULES_LOGGED_EVENTS environment variable.
Introduce the --with-logger and --with-logger-opts configure options to
choose at installation time the default logger command and its options
to use to log information. Default logger is 'logger' and its default
options are '-t modules'.
Add logger configuration option that defines the command to execute to
log some information about module evaluations. Set to "logger -t
modules" by default. When configuration is modified it sets the
MODULES_LOGGER environment variable.
Add "lsb-release" modulefile command available from modulerc and
modulefile evaluation context. This command accepts a sub-command as
argument among id, description, release and codename. This new modulefile
command relies on the corresponding "lsb_*" new states, which in turns
rely on the result of the lsb_release external command.
When auto handling mode is enabled and module requirement has to be
loaded, pass down the constrained modulepath list toward cmdModuleLoad
and getPathToModule in order to obtain resolve modulefile location
within the constrained list.
The list of modulepaths set on --modulepath prereq option is converted.
These entries are left as-is if not found in the list of enabled
modulepaths. These entries are converted into the enabled modulepaths
they match otherwise.
If required module is already loaded from a modulepath not part of
constrained list, an error is raised. This error is similar to the load
of an already loaded module with a different variant set.
When resolving module requirement (in no-auto mode), verify the loaded
or loading modules match one of the specified modulepaths if any.
Update getLoadedMatchingName procedure to pass it specified modulepaths
then verify matching module also match one of these modulepaths.
Add isModulefileInModulepathList and getModulefileFromLoadingModule
helper procedures.
Add --modulepath option to prereq, prereq-all and always-load commands.
This commit adds management of the new option.
Later commits will make this option reduce the scope of the requirement
search to the sole defined modulepaths.