Commit Graph

314 Commits

Author SHA1 Message Date
Xavier Delaruelle
b97486fefa init: add collection_pin_tag config to completion scripts 2022-04-01 06:58:35 +02:00
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
Xavier Delaruelle
cd4015b106 Revert work on noglob_eval_shells config option
Remove entirely the work on the noglob_eval_shells option as enclosing
in quotes the generated output of modulecmd.tcl to pass it to the eval
command is equivalent to disable the pathname expansion mechanism of
sh-kind shells.
2022-02-24 18:24:47 +01:00
Xavier Delaruelle
661c47aa17 init: translate `` into $() for sh-kind shells 2022-02-24 17:46:41 +01:00
Xavier Delaruelle
53f965f1c4 init: add noglob_eval_shells config to completion scripts 2022-02-19 15:56:44 +01:00
Dimitri Papadopoulos
68f400fccf init: fix typo in comment 2022-02-17 07:51:31 +01:00
Xavier Delaruelle
939d11c15e init: add mcookie_check config to completion script 2022-01-02 21:14:21 +01:00
Xavier Delaruelle
71888cbe9f init: add load-any sub-cmd to completion scripts 2021-12-24 16:04:16 +01:00
Xavier Delaruelle
fae13159f8 init: add --tag= opt to completion scripts 2021-12-08 08:16:24 +01:00
Xavier Delaruelle
ff1db855ba install: add --with-fishcompletiondir configure opt
Add the --with-fishcompletiondir option to the configure installation
script to define a particular installation directory for the fish
completion script.

If option is not defined, fish completion script is installed by default
in initdir and it is sourced in fish init script. If option is set,
completion script is installed in designated directory and fish init
script does not source it.
2021-11-24 08:51:03 +01:00
Xavier Delaruelle
ee37f69f46 install: add --with-bashcompletiondir configure opt
Add the --with-bashcompletiondir option to the configure installation
script to define a particular installation directory for the bash
completion script.

If option is not defined, bash completion script is installed by default
in initdir and it is sourced in bash init script. If option is set,
completion script is installed in designated directory and bash init
script does not source it.
2021-11-24 08:51:03 +01:00
Xavier Delaruelle
b483dbf7c3 install: add --with-zshcompletiondir configure opt
Add the --with-zshcompletiondir option to the configure installation
script to define a particular installation directory for the zsh
completion script.

If option is not defined, zsh completion script is installed by default
in initdir and the FPATH environment variable is set in zsh init script.
If option is set, completion script is installed in designated directory
and zsh init script does not set the FPATH environment variable.

Fixes #428
2021-11-24 08:50:52 +01:00
Xavier Delaruelle
0a96ed642c init: add state subcmd to completion scripts 2021-10-19 21:48:35 +02:00
Xavier Delaruelle
0c1ae43a2f Add output redirection handling on sh module function
Update the definition of the module function for sh shell family (sh,
bash, ksh and zsh) to support the output redirection.

Now both _module_raw and module shell functions are always defined.
Default redirection behavior depends on the interactiveness of the shell
when the autoinit command is run. Then shell code is set in module
function definition to adapt behavior depending on
MODULES_REDIRECT_OUTPUT environment variable value or
--redirect/--no-redirect command-line switches.
2021-10-17 20:10:36 +02:00
Xavier Delaruelle
abfef4ed17 init: add redirect_output config to completion script 2021-10-17 20:09:36 +02:00
Xavier Delaruelle
4caa65b9de init: set min version required to run default initrc
Set in the module magic cookie of the initrc configuration file
installed by default the version of Modules required to evaluate this
file.

Set version to 5.0 as current configuration file mention the
quarantine_support configuration option.
2021-10-13 07:12:00 +02:00
Xavier Delaruelle
ebc1900e6f init: example to enable silent_shell_debug in dfl initrc 2021-09-01 07:24:03 +02:00
Xavier Delaruelle
7d61eace20 init: always set code for silent_shell_debug code
Update initialization scripts to make the code for the
silent_shell_debug mechanism always defined there.
2021-08-31 07:22:01 +02:00
Xavier Delaruelle
1c8f3c267b init: example to enable quarantine_support in dfl initrc 2021-08-26 21:25:16 +02:00
Xavier Delaruelle
57c04bbc8f init: add quarantine_support config to completion script 2021-08-26 20:14:06 +02:00
Xavier Delaruelle
4baf5dc4db Add quarantine_support configuration option
Convert the --enable-quarantine-support installation option in a
quarantine_support configuration option. When this option is enabled the
autoinit sub-command produces the module shell code with quarantine
mecahnism support. When disabled, code is generated without quarantine
support.

This way decision to have or not the quarantine mechanism code can also
be made in initrc configuration file. As a result
--enable-quarantine-support installation option new controls the default
behavior to generate or not the quarantine code, but this could now be
superseded in initrc configuration file.

Different setup cases are foreseen:
1. quarantine code has been included in module shell function, then
   quarantine_support config is disabled
   > config disablement is not effective as shell code is already set
2. quarantine code has not been included in module shell function,
   then quarantine_support config is enabled
   >  config enablement is not effective as shell code is already set
3. during module initialization, quarantine_support config is enabled in
   initrc
   > shell code generated with quarantine code
4. during module initialization, quarantine_support config is disabled
   in initrc
   > shell code generated without quarantine code
5. during module initialization, quarantine_support config is enabled by
   default or via env
   > shell code generated with quarantine code
6. during module initialization, quarantine_support config is disabled by
   default or via env
   > shell code generated with quarantine code
2021-08-26 20:13:51 +02: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
63a36443a5 init: remove useless '1.0' in initrc magic cookie
Remove the '1.0' in the #%Module magic cookie header of the generated
initrc configuration file. Users may define a more appropriate magic
cookie compatibility version.
2021-08-21 18:36:55 +02:00
Xavier Delaruelle
d3e066aa01 init: set modulepaths only in modulespath if installed
When the installation option `--enable-modulespath` is set, the list of
modulepath to enable by default is now only defined in the `modulespath`
configuration file and not anymore in the `initrc` configuration file.
2021-08-17 20:12:31 +02:00
Xavier Delaruelle
e48e8a45d4 install: use bash shell to translate init scripts
Set init Makefile to use bash as shell to correctly expand the $''
syntax used in translate-in-script.
2021-08-16 07:05:35 +02:00
Xavier Delaruelle
ca6783c6a2 init: add example code to load init env in initrc
Add example code in default initrc, the initialization script of
Modules, to either restore user's default collection if it exists or
load a predefined module list when initializating Modules.
2021-08-16 07:05:35 +02:00
Xavier Delaruelle
cba8e090c2 init: update refresh subcmd desc in completion scripts 2021-08-13 07:53:54 +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
09e9251e18 install: remove compat version-related rules 2021-07-24 14:06:09 +02:00
Xavier Delaruelle
0f76f1f13b init: name default config files initrc/modulespath
Rename the configuration template files following the new default naming
scheme for these files: modulerc becomes initrc and .modulespath becomes
modulespath.
2021-07-24 14:06:06 +02:00
Xavier Delaruelle
664808acd7 install: swap --enable-dotmodulespath/--enable-modulespath
Make --enable-modulespath the primary option name and
--enable-dotmodulespath the secondary option name as .modulespath is not
anymore the primary name of this configuration file.
2021-07-18 22:06:02 +02:00
Xavier Delaruelle
6050cb7216 install: set --enable-set-shell-startup off by default
Installation option '--enable-set-shell-startup' is set off by default
but could be enabled once installed through the `initrc` configuration
file.

It seems better to let people choose to enable this option than being
surprised to find Modules initialization script run automatically each
time a sub-shell is spawn.
2021-07-16 22:04:27 +02:00
Xavier Delaruelle
35e559764e Inhibit rcexpandparam Zsh option when initializing
Protect quarantine mechanism code from 'rcexpandparam' Zsh option when
initializing the module command on this shell.

Fixes #403
2021-07-13 13:31:31 +02:00
Xavier Delaruelle
e26a2d86cf init: update stderr redirection in fish init script
Use of '^' character to redirect stderr has been deprecated starting
Fish version 3.1. It now produces an error. Stderr should be redirected
with '2>' like on SH shells. Hopefully '2>' redirection is also
supported on old Fish versions (all version 2 support it).

This update was performed on modulecmd.tcl with 711c901 commit, but fish
initialization script was forgotten at that time.
2021-07-04 20:56:45 +02:00
Xavier Delaruelle
e11acd3fcb init: add try-load sub-cmd to completion scripts 2021-06-30 21:54:06 +02:00
Xavier Delaruelle
09aec34876 init: add edit sub-cmd to completion scripts 2021-06-30 21:48:49 +02:00
Xavier Delaruelle
20a7015a41 init: add variant_shortcut config to completion script 2021-06-28 20:44:23 +02:00
Xavier Delaruelle
95296fd75e init: add editor config to completion script 2021-04-24 13:36:51 +02:00
Anais GAERTNER
36b32fc24f init: add -w/--width options to completion scripts 2021-02-18 09:45:58 +01:00
Anais GAERTNER
e3548dc5d7 init: add term_width config to completion script 2021-02-18 09:45:58 +01:00
Xavier Delaruelle
b41655eb30 install: silently include version.inc in Makefiles
Silently include version.inc in main, doc and init Makefiles to avoid
'Makefile:349: version.inc: No such file or directory' warning message
when version.inc needs to be rebuilt prior being loaded.
2021-02-17 16:04:04 +01:00
Xavier Delaruelle
7518083803 install: no include of version.inc for 'clean' make goals 2021-02-17 16:04:04 +01:00
Xavier Delaruelle
d3b45ff648 install: build ../version.inc from init/doc Makefiles
Add makefile rule to build ../version.inc file if missing from the init
and doc Makefiles.
2021-02-17 16:04:04 +01:00
Xavier Delaruelle
94df593f4a install: pretty print on makefile build targets
Print generated file names rather commands executed to generate these
files on makefile build targets. Output when making Modules is this way
simplified. When option `V=1` is passed to make verbose mode is enabled
and executed commands are shown.

Simplified make output does not apply to the install, uninstall, test,
clean, distclean targets and their relatives.
2021-02-17 16:04:03 +01:00
Xavier Delaruelle
5115e42fad init: add completion of -a/--all opt on list sub-cmd 2021-02-09 06:29:48 +01:00
Xavier Delaruelle
b885eb2c4c init: add -o/--output options to completion scripts 2021-02-09 06:26:09 +01:00
Xavier Delaruelle
3c8746d264 init: use -o option instead of sed in completion scripts
Update shell completion scripts to make use of the module option -o to
control the element to find in output rather using sed command to discard
the unwanted elements.
2021-02-09 05:58:59 +01:00
Xavier Delaruelle
dba0bb2f0c init: add {avail,list}_*output configs to completion scripts 2021-02-08 07:17:37 +01:00