Update python initialization script to explicitly send error output
to the sys.stderr channel (instead of parent process stderr channel) to
be able to catch this content.
Introduce the __MODULES_QUARANTINE_SET environment variable to put back
when starting modulecmd.tcl run the environment set on hold by
initialization script (for autoinit calls) or by module shell function
(for regular calls).
This new environment variable is tested to apply quarantine unhold
mechanism instead of checking if the run_quarantine configuration option
is set and shell accurately supports the mecanishm. With this change it
is possible to enable or disable the quarantine support at module
initialization time (through initrc configuration file) instead of
freezing this configuration when building the modulecmd.tcl script.
Rename the environment variables used to indirectly pass to
`modulecmd.tcl` the value of variables set in quarantine (variables
whose name finishes with `_modquar`). A `__MODULES_QUAR_` prefix is
applied to the name of these variables instead of the `_modquar` suffix
to indicate they are intended for Modules internal use of only.
Take into account Modules initialization configurations found in ``etc``
directory if they exist rather in ``init`` directory. If ``initrc``
configuration file is found in ``etcdir`` then it is preferred over
``modulerc`` file in ``initdir``. Following the same trend,
``modulespath`` configuration file is found in ``etcdir`` then it is
preferred over ``.modulespath`` file in ``initdir``.
Add the ability to control whether or not code to support quarantine
mechanism should be added to the module function and initialization
scripts. Enabled by default
Fixes#167
Make compatibility module function to always return a value to be able
to check function result either new main version or compat version is
called.
Adapt cmake, perl, python and ruby compat module function to return a
true value. Always true is returned as compat version does not handle
returning error exit code.
Add --with-quarantine-vars configure option to define quarantine
mechanism configuration at build time.
Value passed to the configure option will be used by Makefile to
initialize in the various initialization scripts the
MODULES_RUN_QUARANTINE variable and eventual MODULES_RUNENV_<VAR>.
Make use of autoinit module command to initialize module command and its
initial surrounding environment (default value for MODULESHOME,
MODULEPATH, LOADEDMODULES and parse of init/.modulespath).
Then if compatibility version is currently activated redefined the
module command to point to the compat binary. But the compat version
will benefit from the surrounding environment initialization made by
autoinit.
With this change, activated compatibility version will also get its
environment initialized by the init/modulerc file whereas before this
change only the main version was affected by this setup file.
Introduce MODULE_USE_COMPAT_VERSION environment variable to control the
activation of the compatibility version rather main version in case of
--enable-compat-version installation.
The initialization script of the shells supporting compatibility version
are adapted to define the 'module' command based on the modulecmd-compat
binary if MODULE_USE_COMPAT_VERSION is set to 1. Elsewhere module is
based on modulecmd.tcl.
'switchml' function of alias is reintroduced to switch between main and
compatibility version based on the state of the
MODULE_USE_COMPAT_VERSION environment variable.
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.