install: add --with-noglob-eval-shells configure opt

Introduce the --with-noglob-eval-shells configure option to choose at
installation time if the pathname expansion should be disabled or not in
the module function to evaluate shell code produced by modulecmd.tcl,
for the shells listed in option value.
This commit is contained in:
Xavier Delaruelle
2022-02-13 15:48:05 +01:00
parent 0d820307f6
commit 67b5fedad9
5 changed files with 28 additions and 3 deletions

View File

@@ -311,6 +311,7 @@ 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,6 +140,9 @@ bashcompletiondir := @bashcompletiondir@
fishcompletiondir := @fishcompletiondir@
zshcompletiondir := @zshcompletiondir@
# shell-specific behaviors
noglobevalshells := @noglobevalshells@
# command location
TCLSH := @TCLSH@
PYTHON := @PYTHON@

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"
zshcompletiondir noglobevalshells"
libarglist=
# flags to know if argument has been specified on command-line
@@ -127,6 +127,7 @@ variantshortcut=
bashcompletiondir=
fishcompletiondir=
zshcompletiondir=
noglobevalshells='sh:bash:ksh'
# check if output/error channels are attached to terminal
@@ -391,6 +392,12 @@ 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
@@ -760,6 +767,18 @@ 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

@@ -97,6 +97,8 @@ 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

@@ -92,8 +92,8 @@ 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 sh:bash:ksh 0 {sh bash ksh\
zsh} {} {} eltlist}\
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}}\