install/doc: add abort_on_error support for unload subcmd

This commit is contained in:
Xavier Delaruelle
2023-11-08 07:13:55 +01:00
parent 3cd464c0db
commit d2a188b247
5 changed files with 25 additions and 10 deletions

View File

@@ -746,8 +746,9 @@ instance :instopt:`--without-modulepath<--with-modulepath>`):
When evaluating multiple modulefiles, if one fails abort evaluation sequence
and withdraw already evaluated modulefiles for listed module sub-commands.
Sub-commands accepted in LIST are: :subcmd:`load`, :subcmd:`mod-to-sh` and
:subcmd:`try-load` (elements in LIST are separated by ``:``). (default=)
Sub-commands accepted in LIST are: :subcmd:`load`, :subcmd:`mod-to-sh`,
:subcmd:`try-load` and :subcmd:`unload` (elements in LIST are separated by
``:``). (default=)
This installation option defines the default value of the
:mconfig:`abort_on_error` configuration option which could be changed after

View File

@@ -83,6 +83,8 @@ Modules 5.4.0 (not yet released)
by default. When set, it defines the :envvar:`MODULES_SOURCE_CACHE`
environment variable. Default value can be changed with
:instopt:`--enable-source-cache` installation option.
* Add support for :mconfig:`abort_on_error` evaluation behavior on
:subcmd:`unload` sub-command.
.. _5.3 release notes:

7
configure vendored
View File

@@ -386,8 +386,9 @@ Optional Packages:
list of sub-commands that should abort when a module
evaluation fails instead of continuing their
evaluation sequence. sub-commands accepted in LIST
are: \`load', \`mod-to-sh' and \`try-load' (elements
in LIST are separated by \`:') [$abortonerror]
are: \`load', \`mod-to-sh', \`try-load' and
\`unload' (elements in LIST are separated by \`:')
[$abortonerror]
--with-avail-output=LIST
specify content to report on avail sub-command
regular output. elements accepted in LIST are:
@@ -782,7 +783,7 @@ for arg in "$@"; do
fi ;;
--with-abort-on-error*|--without-abort-on-error)
abortonerror=$(get_package_value "$arg" "$abortonerror") ;
allowedval=" load mod-to-sh try-load " ;
allowedval=" load mod-to-sh try-load unload " ;
ORIG_IFS=$IFS ;
IFS=: ;
for val in $abortonerror; do

View File

@@ -335,11 +335,19 @@ Multiple modulefiles passed as argument
When multiple modulefiles are passed to the ``unload`` sub-command for
evaluation. If the evaluation of one modulefile raises an error, behavior for
this error is applied and:
this error is applied and if:
* already evaluated modulefiles from the argument list are kept unloaded
* for other kind of error, evaluation continues with next modulefile in
argument list
* :mconfig:`abort_on_error` configuration option does not contain ``unload``:
* already evaluated modulefiles from the argument list are kept unloaded
* for other kind of error, evaluation continues with next modulefile in
argument list
* :mconfig:`abort_on_error` configuration option contains ``load``:
* already evaluated modulefiles from the argument list are withdrawn (they
will appear loaded again and their environment changes are untouched)
* evaluation stops
The above description only applies to ``unload`` sub-command executed from the
top level context and not from a modulefile evaluation. Multiple arguments on

View File

@@ -2464,7 +2464,9 @@ Module Sub-Commands
specified order. If one modulefile evaluation raises an error, unload
sequence continues: unloaded modules prior the evaluation error are kept
unloaded and sequence is resumed with the unload of remaining modulefile in
list.
list. Conversely, unload sequence is aborted and already unloaded modulefiles
are restored if :subcmd:`unload` sub-command is defined in
:mconfig:`abort_on_error` configuration option.
.. only:: html
@@ -3864,6 +3866,7 @@ ENVIRONMENT
* :subcmd:`load`
* :subcmd:`mod-to-sh`
* :subcmd:`try-load`
* :subcmd:`unload`
Module sub-commands not configured to follow the *abort on error* behavior,
apply the *continue on error* behavior. In this case if one modulefile