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.
This commit is contained in:
Xavier Delaruelle
2022-02-24 18:09:33 +01:00
parent 661c47aa17
commit cd4015b106
19 changed files with 21 additions and 225 deletions

View File

@@ -65,7 +65,7 @@ jobs:
tcl85-nolibtclenvmodules:
runs-on: ubuntu-18.04
env:
CONFIGURE_OPTS: --with-tclsh=tclsh8.5 --prefix=/tmp/modules --disable-libtclenvmodules --with-tcl=/usr/lib/tcl8.5 --enable-versioning --with-loadedmodules=null:dot --without-pager --disable-avail-indepth --with-terminal-background=light --with-unload-match-order=returnfirst --disable-implicit-default --with-search-match=contains --with-locked-configs=extra_siteconfig --disable-auto-handling --disable-extended-default --disable-advanced-version-spec --disable-color --with-icase=never --with-noglob-eval-shells=
CONFIGURE_OPTS: --with-tclsh=tclsh8.5 --prefix=/tmp/modules --disable-libtclenvmodules --with-tcl=/usr/lib/tcl8.5 --enable-versioning --with-loadedmodules=null:dot --without-pager --disable-avail-indepth --with-terminal-background=light --with-unload-match-order=returnfirst --disable-implicit-default --with-search-match=contains --with-locked-configs=extra_siteconfig --disable-auto-handling --disable-extended-default --disable-advanced-version-spec --disable-color --with-icase=never
COVERAGE: y
EXTRA_SCRIPT_PRETEST: make install-testinitrc install-testsiteconfig
EXTRA_SCRIPT_POSTTEST: make uninstall-testconfig
@@ -119,7 +119,7 @@ jobs:
tcl85-2:
runs-on: ubuntu-18.04
env:
CONFIGURE_OPTS: --with-tclsh=tclsh8.5 --prefix=/tmp/modules --with-tcl=/usr/lib/tcl8.5 --enable-quarantine-support --enable-silent-shell-debug-support --enable-modulespath --with-pager=more --with-dark-background-colors=hi --with-locked-configs=implicit_default --enable-wa-277 --enable-advanced-version-spec --disable-ml --disable-implicit-requirement --enable-set-shell-startup --with-noglob-eval-shells=zsh:sh:ksh:bash
CONFIGURE_OPTS: --with-tclsh=tclsh8.5 --prefix=/tmp/modules --with-tcl=/usr/lib/tcl8.5 --enable-quarantine-support --enable-silent-shell-debug-support --enable-modulespath --with-pager=more --with-dark-background-colors=hi --with-locked-configs=implicit_default --enable-wa-277 --enable-advanced-version-spec --disable-ml --disable-implicit-requirement --enable-set-shell-startup
COVERAGE: y
EXTRA_SCRIPT_PRETEST: make install-testinitrc-1 install-testetcrc install-testmodspath
EXTRA_SCRIPT_POSTTEST: make uninstall-testconfig

View File

@@ -881,17 +881,6 @@ instance :instopt:`--without-modulepath<--with-modulepath>`):
.. versionadded:: 4.6
.. instopt:: --with-noglob-eval-shells=LIST
For the listed shells, disable pathname expansion in module shell function to
evaluate shell code produced by modulecmd.tcl. Shells accepted in LIST are
``sh``, ``bash``, ``ksh`` and ``zsh`` (elements in LIST are separated by
``:``) (default=\ ``sh:bash:ksh``)
.. only:: html
.. versionadded:: 5.1
.. instopt:: --with-pager=BIN
Name or full path of default pager program to use to paginate informational

View File

@@ -311,7 +311,6 @@ sed -e 's|@prefix@|$(prefix)|g' \
-e 's|@implicitrequirement@|$(setimplicitrequirement)|g' \
-e 's|@availindepth@|$(setavailindepth)|g' \
-e 's|@silentshdbgsupport@|$(setsilentshdbgsupport)|g' \
-e 's|@noglobevalshells@|$(noglobevalshells)|g' \
-e 's|@ml@|$(setml)|g' \
-e 's|@setshellstartup@|$(setsetshellstartup)|g' \
-e 's|@mcookieversioncheck@|$(setmcookieversioncheck)|g' \

View File

@@ -140,9 +140,6 @@ bashcompletiondir := @bashcompletiondir@
fishcompletiondir := @fishcompletiondir@
zshcompletiondir := @zshcompletiondir@
# shell-specific behaviors
noglobevalshells := @noglobevalshells@
# command location
TCLSH := @TCLSH@
PYTHON := @PYTHON@

View File

@@ -141,13 +141,6 @@ Modules 5.1.0 (not yet released)
:subcmd:`sh-to-mod` sub-command and :mfcmd:`source-sh` modulefile command.
* Fix typos found in code, tests and documentation. (contribution from Dimitri
Papadopoulos Orfanos)
* Add the :mconfig:`noglob_eval_shells` configuration option to list the shell
for which pathname expansion should be disabled for the time of the
evaluation of shell code in :command:`module` shell function. Installation
option :instopt:`--with-noglob-eval-shells` controls the default value of
:mconfig:`noglob_eval_shells` configuration option. If not set at
installation time, option is enabled for *sh*, *bash* and *ksh* shells by
default.
* Update the :subcmd:`sh-to-mod` and :mfcmd:`source-sh` mechanisms to support
nested function definition on fish shell.
* Fix the :subcmd:`sh-to-mod` and :mfcmd:`source-sh` mechanisms to correctly

21
configure vendored
View File

@@ -39,7 +39,7 @@ searchmatch modulepath loadedmodules quarantinevars wa277 advversspec ml \
windowssupport nearlyforbiddendays implicitrequirement tagabbrev \
tagcolorname mcookieversioncheck availoutput availterseoutput listoutput \
listterseoutput editor variantshortcut bashcompletiondir fishcompletiondir \
zshcompletiondir noglobevalshells"
zshcompletiondir"
libarglist=
# flags to know if argument has been specified on command-line
@@ -127,7 +127,6 @@ variantshortcut=
bashcompletiondir=
fishcompletiondir=
zshcompletiondir=
noglobevalshells='sh:bash:ksh'
# check if output/error channels are attached to terminal
@@ -392,12 +391,6 @@ Optional Packages:
SHORTCUTLIST are separated by \`:') [$variantshortcut]
--with-editor=BIN name or full path of default editor program to use to
edit modulefiles [$editor]
--with-noglob-eval-shells=LIST
for the listed shells disable pathname expansion in
module shell function to evaluate shell code
produced by modulecmd.tcl. shells accepted in LIST
are \`sh', \`bash', \`ksh' and \`zsh' (elements in
LIST are separated by \`:') [$noglobevalshells]
--with-modulepath=PATHLIST
default modulepaths to set in default configuration
file to be enabled (each path in PATHLIST should
@@ -767,18 +760,6 @@ for arg in "$@"; do
variantshortcut=$(get_package_value "$arg") ;;
--with-editor=*|--without-editor)
editor=$(get_package_value "$arg") ;;
--with-noglob-eval-shells*|--without-noglob-eval-shells)
noglobevalshells=$(get_package_value "$arg" "$noglobevalshells") ;
allowedval=" sh bash ksh zsh " ;
ORIG_IFS=$IFS ;
IFS=: ;
for val in $noglobevalshells; do
if [ "${allowedval// $val /}" = "$allowedval" ]; then
echo_error "Bad value '$val' set in option \`--with-noglob-eval-shells'"\
"Values allowed in list are:$allowedval"
fi ;
done ;
IFS=$ORIG_IFS ;;
--with-modulepath=*|--without-modulepath)
modulepath=$(get_package_value "$arg") ;;
--with-loadedmodules=*|--without-loadedmodules)

View File

@@ -871,8 +871,7 @@ The following environment variables appeared on Modules 5.
+------------+-----------------------------------------------------------------+
| 5.1 | :envvar:`MODULES_REDIRECT_OUTPUT`, |
| | :envvar:`MODULES_MCOOKIE_CHECK`, |
| | :envvar:`MODULES_FAMILY_\<NAME\>`, |
| | :envvar:`MODULES_NOGLOB_EVAL_SHELLS` |
| | :envvar:`MODULES_FAMILY_\<NAME\>` |
+------------+-----------------------------------------------------------------+
Modules Specific Tcl Commands
@@ -941,6 +940,5 @@ The following Modules configuration option has been introduced on Modules 5.
+============+=================================================================+
| 5.0 | :mconfig:`quarantine_support` |
+------------+-----------------------------------------------------------------+
| 5.1 | :mconfig:`redirect_output`, :mconfig:`mcookie_check`, |
| 5.1 | :mconfig:`noglob_eval_shells` |
| 5.1 | :mconfig:`redirect_output`, :mconfig:`mcookie_check` |
+------------+-----------------------------------------------------------------+

View File

@@ -799,16 +799,6 @@ Module Sub-Commands
.. versionadded:: 4.6
.. mconfig:: noglob_eval_shells
Disable pathname expansion in :command:`module` shell function for the time
of the evaluation of the code produced by :file:`modulecmd.tcl`. Apply that
to the listed shells. Defines :envvar:`MODULES_NOGLOB_EVAL_SHELLS`.
.. only:: html
.. versionadded:: 5.1
.. mconfig:: pager
Text viewer to paginate message output. Defines :envvar:`MODULES_PAGER`.
@@ -2788,24 +2778,6 @@ ENVIRONMENT
.. versionadded:: 4.6
.. envvar:: MODULES_NOGLOB_EVAL_SHELLS
A list of shell on which the pathname expansion is disabled for the time of
the evaluation of the shell code produced by :file:`modulecmd.tcl` in the
:command:`module` shell function.
To generate the code to disable pathname expansion in the :command:`module`
shell function, :envvar:`MODULES_NOGLOB_EVAL_SHELLS` should be set prior
Modules initialization or the :mconfig:`noglob_eval_shells` configuration
option should be set in the :file:`initrc` configuration file.
Accepted values are a list of shell among *sh*, *bash*, *ksh* ans *zsh*
separated by colon character (``:``).
.. only:: html
.. versionadded:: 5.1
.. envvar:: MODULES_PAGER
Text viewer for use to paginate message output if error output stream is

View File

@@ -169,7 +169,7 @@ comp_aliases_opts := -a --all
comp_isavail_opts := -a -i --all --icase
comp_path_opts := -d --delim --duplicates
comp_rm_path_opts := -d --delim --index
comp_config_opts := --dump-state --reset advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output collection_pin_version collection_target color colors contact editor extended_default extra_siteconfig home icase implicit_default implicit_requirement list_output list_terse_output locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days noglob_eval_shells pager quarantine_support rcfile redirect_output run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277
comp_config_opts := --dump-state --reset advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output collection_pin_version collection_target color colors contact editor extended_default extra_siteconfig home icase implicit_default implicit_requirement list_output list_terse_output locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days pager quarantine_support rcfile redirect_output run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277
define translate-in-script
$(ECHO_GEN)

View File

@@ -63,7 +63,7 @@ complete -c module -n '__fish_module_use_savelist' -f -a "(module savelist --col
/Named collection list\$/d; \
/:\$/d; \
/:ERROR:/d;')"
complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output collection_pin_version collection_target color colors contact editor extended_default extra_siteconfig home icase implicit_default implicit_requirement list_output list_terse_output locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days noglob_eval_shells pager quarantine_support rcfile redirect_output run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277"
complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output collection_pin_version collection_target color colors contact editor extended_default extra_siteconfig home icase implicit_default implicit_requirement list_output list_terse_output locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days pager quarantine_support rcfile redirect_output run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277"
complete -f -n '__fish_module_no_subcommand' -c module -a 'help' --description 'Print this or modulefile(s) help info'
complete -f -n '__fish_module_no_subcommand' -c module -a 'avail' --description 'List all or matching available modules'

View File

@@ -291,7 +291,7 @@ _module() {
_arguments \
'--dump-state[Report each state value of current Modules execution]' \
'--reset[Unset environment variable relative to configuration key]' \
'1:configuration key:(advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output collection_pin_version collection_target color colors contact editor extended_default extra_siteconfig home icase implicit_default implicit_requirement list_output list_terse_output locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days noglob_eval_shells pager quarantine_support rcfile redirect_output run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277)' \
'1:configuration key:(advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output collection_pin_version collection_target color colors contact editor extended_default extra_siteconfig home icase implicit_default implicit_requirement list_output list_terse_output locked_configs mcookie_check mcookie_version_check ml nearly_forbidden_days pager quarantine_support rcfile redirect_output run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug tag_abbrev tag_color_name term_background term_width unload_match_order variant_shortcut verbosity wa_277)' \
&& ret=0
;;
(edit)

View File

@@ -97,8 +97,6 @@ set install_bashcompletiondir "@bashcompletiondir@"
set install_fishcompletiondir "@fishcompletiondir@"
set install_zshcompletiondir "@zshcompletiondir@"
set install_noglobevalshells "@noglobevalshells@"
# command location
set install_tclsh "@TCLSH@"
set install_python "@PYTHON@"

View File

@@ -719,14 +719,6 @@ alias ml 'module ml \!*' ;}
*) _mlshdbg='' ;;
esac;
fi;}
}
# add code to disable pathname expansion during shell evaluation
if {[getState shell] in [split [getConf noglob_eval_shells] :]} {
append fdef {
case "$-" in
*f*) _mlshopt='' ;;
*) set -f; _mlshopt='f' ;;
esac;}
}
if {[getConf quarantine_support]} {
append fdef "
@@ -766,13 +758,6 @@ alias ml 'module ml \!*' ;}
unset IFS;
fi;
unset _mlre _mlv _mlrv _mlIFS;}
}
if {[getState shell] in [split [getConf noglob_eval_shells] :]} {
append fdef {
if [ -n "${_mlshopt:-}" ]; then
set +$_mlshopt;
fi;
unset _mlshopt;}
}
if {[getConf silent_shell_debug]} {
append fdef {

View File

@@ -92,8 +92,6 @@ array set g_config_defs [list\
ml {MODULES_ML @ml@ 0 {0 1}}\
nearly_forbidden_days {MODULES_NEARLY_FORBIDDEN_DAYS @nearlyforbiddendays@\
0 {0 365} {} {} intbe}\
noglob_eval_shells {MODULES_NOGLOB_EVAL_SHELLS {@noglobevalshells@} 0 {sh\
bash ksh zsh} {} {} eltlist}\
pager {MODULES_PAGER {@pagercmd@} 0}\
rcfile {MODULERCFILE <undef> 0}\
redirect_output {MODULES_REDIRECT_OUTPUT 1 0 {0 1}}\

View File

@@ -30,9 +30,6 @@ if {[info exists env(TESTSUITE_INITRC)]} {
module use [getenv TESTSUITEDIR]/modulefiles.3
module load refresh/5.0
}
noglobeval1 {
module config noglob_eval_shells zsh
}
}
}
catch {module load unk}

View File

@@ -131,9 +131,6 @@ unsetenv_var MODULES_EDITOR
unsetenv_var VISUAL
unsetenv_var EDITOR
# clean any noglob shell config
unsetenv_var MODULES_NOGLOB_EVAL_SHELLS
# clean any additional siteconfig set
catch {unset env(MODULES_SITECONFIG)}

View File

@@ -132,9 +132,6 @@ unsetenv_var MODULES_EDITOR
unsetenv_var VISUAL
unsetenv_var EDITOR
# clean any noglob shell config
unsetenv_var MODULES_NOGLOB_EVAL_SHELLS
# clean any additional siteconfig set
catch {unset env(MODULES_SITECONFIG)}

View File

@@ -91,7 +91,7 @@ if {[info exists insmodrcdata] && [info exists exmodrcdata] && $exmodrcdata eq $
}
set custom {module restore unk}
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 39 { }]]
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 36 { }]]
set tserr_initrc_exinstalled "[msg_load mj]\nload m1\nload m2\n\n[msg_top_load m2 {} m1 {}]\n\nunload m2\n[msg_unload m2]\nunload m1\n[msg_unload m1]\n[msg_unload mj]\nload m1\n[msg_load m1]\nload m3\n[msg_load m3]\n[msg_load {'space yc/4'}]\n$err_path'unk'\n$custom"
set tserr_initrc1_exinstalled [msg_load null]
@@ -155,43 +155,6 @@ set func_silentdbg ""
set end_silentdbg ""
}
set func_noglobeval "\\s*case \"\\\$-\" in
\\s*\\\*f\\\*\\\) _mlshopt='' ;;
\\s*\\\*\\\) set -f; _mlshopt='f' ;;
\\s*esac;\n"
set end_noglobeval "\\s*if \\\[ -n \"\\\${_mlshopt:-}\" \\\]; then
\\s*set \\\+\\\$_mlshopt;
\\s*fi;
\\s*unset _mlshopt;\n"
if {{sh} in [split $install_noglobevalshells :]} {
set func_noglobeval_sh $func_noglobeval
set end_noglobeval_sh $end_noglobeval
} else {
set func_noglobeval_sh {}
set end_noglobeval_sh {}
}
if {{bash} in [split $install_noglobevalshells :]} {
set func_noglobeval_bash $func_noglobeval
set end_noglobeval_bash $end_noglobeval
} else {
set func_noglobeval_bash {}
set end_noglobeval_bash {}
}
if {{ksh} in [split $install_noglobevalshells :]} {
set func_noglobeval_ksh $func_noglobeval
set end_noglobeval_ksh $end_noglobeval
} else {
set func_noglobeval_ksh {}
set end_noglobeval_ksh {}
}
if {{zsh} in [split $install_noglobevalshells :]} {
set func_noglobeval_zsh $func_noglobeval
set end_noglobeval_zsh $end_noglobeval
} else {
set func_noglobeval_zsh {}
set end_noglobeval_zsh {}
}
set func_clean_ifs_quar "\\s*if \\\[ -n \"\\\${_mlIFS\\\+x}\" \\\]; then
\\s*IFS=\\\$_mlIFS;
\\s*else
@@ -203,14 +166,9 @@ set func_clean_ifs $func_clean_ifs_quar
} else {
set func_clean_ifs ""
}
set func_end_sh "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_noglobeval_sh$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_bash "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_noglobeval_bash$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_ksh "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_noglobeval_ksh$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_zsh "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_noglobeval_zsh$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_bash_quar "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs_quar$end_noglobeval_bash$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_bash_silentdbg "\\s*_mlstatus=\\\$\\\?;\n$end_noglobeval_bash$end_silentdbg_silentdbg\\s*return \\\$_mlstatus;"
set func_end_bash_nonoglobeval "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_zsh_noglobeval "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_noglobeval$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_quar "\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs_quar$end_silentdbg\\s*return \\\$_mlstatus;"
set func_end_silentdbg "\\s*_mlstatus=\\\$\\\?;\n$end_silentdbg_silentdbg\\s*return \\\$_mlstatus;"
set func_modcmd_bash_quar "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then
\\s*_mlre=\"\\\${_mlre:-}__MODULES_QUARANTINE_SET=1 \";
@@ -302,15 +260,13 @@ set add_func_fish "\nfunction module
\\s*end
end"
set func_bash_quar "$func_name\\\(\\\) {\n$func_silentdbg$func_noglobeval_bash$func_quar_sh_quar$func_modcmd_bash_quar\n$func_end_bash_quar\n};$add_func_sh"
set func_bash_silentdbg "$func_name\\\(\\\) {\n$func_silentdbg_silentdbg$func_noglobeval_bash$func_quar_sh$func_modcmd_bash\n$func_end_bash_silentdbg\n};$add_func_sh"
set func_bash_nonoglobeval "$func_name\\\(\\\) {\n$func_silentdbg$func_quar_sh$func_modcmd_bash\n$func_end_bash_nonoglobeval\n};$add_func_sh"
set func_zsh_noglobeval "$func_name\\\(\\\) {\n$func_silentdbg$func_noglobeval$func_quar_zsh$func_modcmd_zsh\n$func_end_zsh_noglobeval\n};$add_func_sh"
set func_bash_quar "$func_name\\\(\\\) {\n$func_silentdbg$func_quar_sh_quar$func_modcmd_bash_quar\n$func_end_quar\n};$add_func_sh"
set func_bash_silentdbg "$func_name\\\(\\\) {\n$func_silentdbg_silentdbg$func_quar_sh$func_modcmd_bash\n$func_end_silentdbg\n};$add_func_sh"
set func_sh "$func_name\\\(\\\) {\n$func_silentdbg$func_noglobeval_sh$func_quar_sh$func_modcmd_sh\n$func_end_sh\n};$add_func_sh"
set func_bash "$func_name\\\(\\\) {\n$func_silentdbg$func_noglobeval_bash$func_quar_sh$func_modcmd_bash\n$func_end_bash\n};$add_func_sh"
set func_ksh "$func_name\\\(\\\) {\n$func_silentdbg$func_noglobeval_ksh$func_quar_sh$func_modcmd_ksh\n$func_end_ksh\n};$add_func_ksh"
set func_zsh "$func_name\\\(\\\) {\n$func_silentdbg$func_noglobeval_zsh$func_quar_zsh$func_modcmd_zsh\n$func_end_zsh\n};$add_func_sh"
set func_sh "$func_name\\\(\\\) {\n$func_silentdbg$func_quar_sh$func_modcmd_sh\n$func_end\n};$add_func_sh"
set func_bash "$func_name\\\(\\\) {\n$func_silentdbg$func_quar_sh$func_modcmd_bash\n$func_end\n};$add_func_sh"
set func_ksh "$func_name\\\(\\\) {\n$func_silentdbg$func_quar_sh$func_modcmd_ksh\n$func_end\n};$add_func_ksh"
set func_zsh "$func_name\\\(\\\) {\n$func_silentdbg$func_quar_zsh$func_modcmd_zsh\n$func_end\n};$add_func_sh"
set eval_cmd_csh [expr {$install_wa277 eq {y} ? "eval `$tclshlocre $modulecmd_pathre csh \\\\!\\*`" : "eval \"`$tclshlocre $modulecmd_pathre csh \\\\!\\*:q`\""}]
set eval_cmd_tcsh [expr {$install_wa277 eq {y} ? "eval `$tclshlocre $modulecmd_pathre tcsh \\\\!\\*`" : "eval \"`$tclshlocre $modulecmd_pathre tcsh \\\\!\\*:q`\""}]
@@ -598,14 +554,10 @@ append func_bash_quar "
\\s*ml\\\(\\\) { module ml \"\\\$\\\@\"; };"
append func_bash_silentdbg "
\\s*ml\\\(\\\) { module ml \"\\\$\\\@\"; };"
append func_bash_nonoglobeval "
\\s*ml\\\(\\\) { module ml \"\\\$\\\@\"; };"
append func_ksh "
\\s*ml\\\(\\\) { module ml \"\\\$\\\@\"; };"
append func_zsh "
\\s*ml\\\(\\\) { module ml \"\\\$\\\@\"; };"
append func_zsh_noglobeval "
\\s*ml\\\(\\\) { module ml \"\\\$\\\@\"; };"
append func_csh "
\\s*alias ml 'module ml \\\\!\\\*' ;"
append func_tcsh "
@@ -1201,7 +1153,7 @@ if {!$insmodspath && $initrc_exinstalled && !$install_setshellstartup && $modrc
}
set linenum [expr {[cmpversion $tclsh_version 8.6] == -1 ? 14 : 21}]
set custom {module restore unk}
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 39 { }]]
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 36 { }]]
set tserr "[msg_load mj]\nload m1\nload m2\n\n[msg_top_load m2 {} m1 {}]\n\nunload m2\n[msg_unload m2]\nunload m1\n[msg_unload m1]\n[msg_unload mj]\nload m1\n[msg_load m1]\nload m3\n[msg_load m3]\n[msg_load {'space yc/4'}]\n$err_path'unk'\n$custom"
testouterr_cmd_re bash autoinit $ans $tserr
@@ -1230,7 +1182,7 @@ if {!$insmodspath && $initrc_exinstalled && !$install_setshellstartup && $modrc
}
set linenum [expr {[cmpversion $tclsh_version 8.6] == -1 ? 14 : 21}]
set custom {module restore unk}
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 39 { }]]
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 36 { }]]
set tserr "[msg_load mj]\nload m1\nload m2\n\n[msg_top_load m2 {} m1 {}]\n\nunload m2\n[msg_unload m2]\nunload m1\n[msg_unload m1]\n[msg_unload mj]\nload m1\n[msg_load m1]\nload m3\n[msg_load m3]\n[msg_load {'space yc/4'}]\n$err_path'unk'\n$custom"
testouterr_cmd_re bash autoinit $ans $tserr
@@ -1268,65 +1220,12 @@ if {!$insmodspath && $initrc_exinstalled && !$install_setshellstartup && $modrc
lappend ans [list unset __MODULES_AUTOINIT_INPROGRESS]
set linenum [expr {[cmpversion $tclsh_version 8.6] == -1 ? 14 : 21}]
set custom {module restore unk}
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 39 { }]]
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 36 { }]]
set tserr "[msg_load mj]\nload m1\nload m2\n\n[msg_top_load m2 {} m1 {}]\n\nunload m2\n[msg_unload m2]\nunload m1\n[msg_unload m1]\n[msg_unload mj]\nload m1\n[msg_load m1]\nload m3\n[msg_load m3]\n[msg_load {'space yc/4'}]\n[msg_load refresh/5.0]\n$err_path'unk'\n$custom"
testouterr_cmd_re bash autoinit $ans $tserr
unsetenv_var TESTSUITE_INITRC
# test impact of noglob eval enablement through initrc config file
setenv_var TESTSUITE_INITRC noglobeval1
set ans [list]
lappend ans [list ERR]
lappend ans [list [set "func_bash_nonoglobeval"]]
if {$install_versioning eq "y"} {
lappend ans [list set MODULE_VERSION_STACK "(.*)"]
}
lappend ans [list set MODULES_CMD $modulecmd_path]
lappend ans [list unset __MODULES_AUTOINIT_INPROGRESS]
lappend ans [list set MODULESHOME $moduleshome]
lappend ans [list set MODULES_NOGLOB_EVAL_SHELLS zsh]
lappend ans [list set __MODULES_LMPREREQ m3&m1]
lappend ans [list set _LMFILES_ "$modpath.deps/m1:$modpath.deps/m3:$modpath wspace/space yc/4"]
lappend ans [list set LOADEDMODULES "m1:m3:space yc/4"]
lappend ans [list set __MODULES_LMTAG m1&auto-loaded]
lappend ans [list set MODULEPATH "$modpath wspace:$modpath.deps"]
if {$install_versioning eq "y"} {
lappend ans [list set MODULE_VERSION "(.*)"]
}
set linenum [expr {[cmpversion $tclsh_version 8.6] == -1 ? 14 : 21}]
set custom {module restore unk}
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 39 { }]]
set tserr "[msg_load mj]\nload m1\nload m2\n\n[msg_top_load m2 {} m1 {}]\n\nunload m2\n[msg_unload m2]\nunload m1\n[msg_unload m1]\n[msg_unload mj]\nload m1\n[msg_load m1]\nload m3\n[msg_load m3]\n[msg_load {'space yc/4'}]\n$err_path'unk'\n$custom"
testouterr_cmd_re bash autoinit $ans $tserr
set ans [list]
lappend ans [list ERR]
lappend ans [list [set "func_zsh_noglobeval"]]
if {$install_versioning eq "y"} {
lappend ans [list set MODULE_VERSION_STACK "(.*)"]
}
lappend ans [list set MODULES_CMD $modulecmd_path]
lappend ans [list unset __MODULES_AUTOINIT_INPROGRESS]
lappend ans [list set MODULESHOME $moduleshome]
lappend ans [list set MODULES_NOGLOB_EVAL_SHELLS zsh]
lappend ans [list set __MODULES_LMPREREQ m3&m1]
lappend ans [list set _LMFILES_ "$modpath.deps/m1:$modpath.deps/m3:$modpath wspace/space yc/4"]
lappend ans [list set LOADEDMODULES "m1:m3:space yc/4"]
lappend ans [list set __MODULES_LMTAG m1&auto-loaded]
lappend ans [list set MODULEPATH "$modpath wspace:$modpath.deps"]
if {$install_versioning eq "y"} {
lappend ans [list set MODULE_VERSION "(.*)"]
}
set linenum [expr {[cmpversion $tclsh_version 8.6] == -1 ? 14 : 21}]
set custom {module restore unk}
set custom [escre [msg_moderr {Collection unk cannot be found} $custom $modrc 39 { }]]
set tserr "[msg_load mj]\nload m1\nload m2\n\n[msg_top_load m2 {} m1 {}]\n\nunload m2\n[msg_unload m2]\nunload m1\n[msg_unload m1]\n[msg_unload mj]\nload m1\n[msg_load m1]\nload m3\n[msg_load m3]\n[msg_load {'space yc/4'}]\n$err_path'unk'\n$custom"
testouterr_cmd_re zsh autoinit $ans $tserr
unsetenv_var TESTSUITE_INITRC
# save installed initrc as following tests will test specific configuration
file rename -force $modrc $modrc.orig

View File

@@ -73,7 +73,6 @@ array set configdfl [list\
mcookie_version_check [expr {$install_mcookieversioncheck eq {y}}]\
ml [expr {$install_ml eq {y}}]\
nearly_forbidden_days $install_nearlyforbiddendays\
noglob_eval_shells $install_noglobevalshells\
pager "$install_pagercmd"\
quarantine_support [expr {$install_quarantinesupport eq {y}}]\
rcfile <undef>\
@@ -119,7 +118,6 @@ array set configvar [list\
mcookie_version_check MODULES_MCOOKIE_VERSION_CHECK\
ml MODULES_ML\
nearly_forbidden_days MODULES_NEARLY_FORBIDDEN_DAYS\
noglob_eval_shells MODULES_NOGLOB_EVAL_SHELLS\
pager MODULES_PAGER\
quarantine_support MODULES_QUARANTINE_SUPPORT\
rcfile MODULERCFILE\
@@ -157,7 +155,6 @@ array set configvalid [list\
mcookie_version_check {0 1}\
ml {0 1}\
nearly_forbidden_days {0 365}\
noglob_eval_shells {sh bash ksh zsh}\
quarantine_support {0 1}\
redirect_output {0 1}\
search_match {starts_with contains}\
@@ -177,7 +174,6 @@ array set configvalidkind [list\
list_output eltlist\
list_terse_output eltlist\
nearly_forbidden_days intbe\
noglob_eval_shells eltlist\
shells_with_ksh_fpath eltlist\
term_width intbe\
]