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
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.
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.
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.
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.
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.
Rename the configuration template files following the new default naming
scheme for these files: modulerc becomes initrc and .modulespath becomes
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.
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.
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.
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.
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.
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.
When initializing module on ksh shell with the autoinit sub-command, add
to the FPATH environment variable the directory where module function is
defined. Which helps to get module function defined in ksh interactive
and non-interactive sub-shells.
This FPATH setup for ksh shell was previously done in ksh initialization
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).
Fixes#325
`-E` option is a *relatively* recent option of GNU sed (v4.2), yet
mandatory for OS portability (as detailled in b68e44e).
Adapt configure step to detect if sed option `-E` is supported and
fallback to `-r` otherwise.
Fixes#317
`compopt` Bash builtin has been introduced in Bash 4.0, so using it on
Bash <4.0 prints error messages. To fix this, `comptopt` availability is
checked prior usage. If not available, the no-space-append behavior will
not be obtained which will not be an optimal situation if the
`no-indepth` mode is set for the `avail` sub-command.
Fixes#318