Commit Graph

20 Commits

Author SHA1 Message Date
Xavier Delaruelle
1e4b272ba8 init: explicitly send err output to sys.stderr in python
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.
2022-03-24 07:04:45 +01:00
Dimitri Papadopoulos
68f400fccf init: fix typo in comment 2022-02-17 07:51:31 +01:00
Xavier Delaruelle
956b377873 Restore quarantine if __MODULES_QUARANTINE_SET defined
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.
2021-08-25 07:29:16 +02:00
Xavier Delaruelle
f6194a9c5e init: quarantine mech always set for autoinit call
Update initialization scripts to make the quarantine mechanism always
defined for the module autoinit call.
2021-08-25 06:07:46 +02:00
Xavier Delaruelle
fc690085b0 Use '__MODULES_QUAR_' prefix on env var set in quarantine
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.
2021-07-25 10:17:04 +02:00
Xavier Delaruelle
91380cdbee init: remove compat version-related code 2021-07-24 14:06:09 +02:00
Xavier Delaruelle
5a33a474d5 Use initconf in etcdir rather initdir if it exists
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``.
2019-07-10 07:04:52 +02:00
Xavier Delaruelle
8fa93a271d install: add --enable-quarantine-support configure opt
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
2018-09-05 06:02:43 +02:00
Xavier Delaruelle
33941816c0 Expose current modulecmd with MODULES_CMD env var 2018-01-03 08:33:22 +01:00
Xavier Delaruelle
dfbdb9f7d1 Return dummy true on compat module function
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.
2017-11-21 21:57:21 +01:00
Xavier Delaruelle
d918ee6d86 install: add --with-quarantine-vars
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>.
2017-11-12 16:56:40 +01:00
Xavier Delaruelle
dde517ba2a Add quarantine mechanism support to python 2017-11-11 16:30:30 +01:00
Xavier Delaruelle
519d08e98d init: shell scripts now rely on autoinit command
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.
2017-10-23 22:35:27 +02:00
Xavier Delaruelle
5c7314c059 init: rename use compat var in MODULES_USE_COMPAT_VERSION
Use a distinguishable prefix for environment variables relative to the
Modules software: 'MODULES_'.
2017-09-22 21:32:37 +02:00
Xavier Delaruelle
fc5674846c init: adapt scripts to --enable-compat-version build
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.
2017-09-13 06:30:19 +02:00
Xavier Delaruelle
e5aa815663 Use file extension for perl/python init script
Rename 'perl' in 'perl.pm' and 'python' into 'python.py' to get same
init script filename than C-version.
2017-08-08 18:21:11 +02: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
rkowen
f2bab390e9 * Removed the $MODULESHOME env.var. which is not used at all. 2010-11-12 20:16:37 +00:00
rkowen
3b33ab4d85 * Reworked configuration and Makefile for fine-grain control of
certain paths and config files.
2010-11-12 16:54:54 +00:00
rkowen
7aea93b75a Rolled in the cmake addition from version 3.2.8,
and the new perl.pm & python.py init files.
2010-10-04 22:06:44 +00:00