install: add --with-sticky-purge configure option

Introduce the --with-sticky-purge configure option to choose at
installation time the default error behavior when unloading a sticky
module during a purge command. Allowed values are error (default),
warning and silent.
This commit is contained in:
Xavier Delaruelle
2023-07-06 06:34:46 +02:00
parent a39a1c1cef
commit 95fe2a308f
5 changed files with 23 additions and 2 deletions

View File

@@ -401,6 +401,7 @@ sed -e 's|@prefix@|$(prefix)|g' \
-e 's|@nearlyforbiddendays@|$(nearlyforbiddendays)|g' \
-e 's|@tagabbrev@|$(tagabbrev)|g' \
-e 's|@tagcolorname@|$(tagcolorname)|g' \
-e 's|@stickypurge@|$(stickypurge)|g' \
-e 's|@availoutput@|$(availoutput)|g' \
-e 's|@availterseoutput@|$(availterseoutput)|g' \
-e 's|@listoutput@|$(listoutput)|g' \

View File

@@ -121,6 +121,9 @@ nearlyforbiddendays := @nearlyforbiddendays@
tagabbrev := @tagabbrev@
tagcolorname := @tagcolorname@
# error behavior when purging sticky module
stickypurge := @stickypurge@
# check version on magic cookie
mcookieversioncheck := @mcookieversioncheck@

16
configure vendored
View File

@@ -38,7 +38,8 @@ searchmatch modulepath loadedmodules quarantinevars wa277 advversspec ml \
windowssupport nearlyforbiddendays implicitrequirement tagabbrev \
tagcolorname mcookieversioncheck availoutput availterseoutput listoutput \
listterseoutput editor variantshortcut bashcompletiondir fishcompletiondir \
zshcompletiondir tcllinter tcllinteropts nagelfardatadir nagelfaraddons"
zshcompletiondir tcllinter tcllinteropts nagelfardatadir nagelfaraddons \
stickypurge"
libarglist=()
# flags to know if argument has been specified on command-line
@@ -116,6 +117,7 @@ windowssupport=n
nearlyforbiddendays=14
tagabbrev='auto-loaded=aL:loaded=L:hidden=H:hidden-loaded=H:forbidden=F:nearly-forbidden=nF:sticky=S:super-sticky=sS:keep-loaded=kL'
tagcolorname=
stickypurge=error
mcookieversioncheck=y
availoutput='modulepath:alias:dirwsym:sym:tag:variantifspec:key'
availterseoutput='modulepath:alias:dirwsym:sym:tag:variantifspec'
@@ -368,6 +370,11 @@ Optional Packages:
the module they are attached to. Each element in
TAGLIST is a tag name or abbreviation (elements in
TAGLIST are separated by \`:') [$tagcolorname]
--with-sticky-purge=VALUE
define the kind of error to render when unloading
a sticky or super-sticky module during a purge.
Raise an \`error' or report a \`warning' or be
\`silent'. [$stickypurge]
--with-avail-output=LIST
specify content to report on avail sub-command
regular output. elements accepted in LIST are:
@@ -747,6 +754,13 @@ for arg in "$@"; do
tagabbrev=$(get_package_value "$arg") ;;
--with-tag-color-name*|--without-tag-color-name)
tagcolorname=$(get_package_value "$arg") ;;
--with-sticky-purge*|--without-sticky-purge)
stickypurge=$(get_package_value "$arg" "error") ;
allowedval=" error warning silent " ;
if [ "${allowedval// $stickypurge /}" = "$allowedval" ]; then
echo_error "Bad value for option \`--with-sticky-purge'"\
"Allowed values are:$allowedval"
fi ;;
--with-avail-output*|--without-avail-output)
availoutput=$(get_package_value "$arg" "$availoutput") ;
allowedval=" modulepath alias dirwsym indesym sym tag key variant variantifspec " ;

View File

@@ -85,6 +85,8 @@ set install_nearlyforbiddendays "@nearlyforbiddendays@"
set install_tagabbrev "@tagabbrev@"
set install_tagcolorname "@tagcolorname@"
set install_stickypurge "@stickypurge@"
set install_mcookieversioncheck "@mcookieversioncheck@"
set install_availoutput "@availoutput@"

View File

@@ -118,7 +118,8 @@ array set g_config_defs [list\
silent_shell_debug {MODULES_SILENT_SHELL_DEBUG @silentshdbgsupport@ 0 b {0\
1}}\
siteconfig {{} {@etcdir@/siteconfig.tcl} 0 s}\
sticky_purge {MODULES_STICKY_PURGE error 0 s {error warning silent}}\
sticky_purge {MODULES_STICKY_PURGE {@stickypurge@} 0 s {error warning\
silent}}\
tag_abbrev {MODULES_TAG_ABBREV {@tagabbrev@} 0 l {} {} initConfTagAbbrev}\
tag_color_name {MODULES_TAG_COLOR_NAME {@tagcolorname@} 0 l {} {}\
initConfTagColorName}\