Add {avail,list}_{terse_,}output configurations

This commit is contained in:
Xavier Delaruelle
2021-01-19 21:22:23 +01:00
parent 57be5170f6
commit f5dfb30fcb
5 changed files with 98 additions and 6 deletions

View File

@@ -300,6 +300,10 @@ sed -e 's|@prefix@|$(prefix)|g' \
-e 's|@nearlyforbiddendays@|$(nearlyforbiddendays)|g' \
-e 's|@tagabbrev@|$(tagabbrev)|g' \
-e 's|@tagcolorname@|$(tagcolorname)|g' \
-e 's|@availoutput@|$(availoutput)|g' \
-e 's|@availterseoutput@|$(availterseoutput)|g' \
-e 's|@listoutput@|$(listoutput)|g' \
-e 's|@listterseoutput@|$(listterseoutput)|g' \
-e 's|@autohandling@|$(setautohandling)|g' \
-e 's|@implicitrequirement@|$(setimplicitrequirement)|g' \
-e 's|@availindepth@|$(setavailindepth)|g' \

View File

@@ -129,6 +129,12 @@ tagcolorname := @tagcolorname@
# check version on magic cookie
mcookieversioncheck := @mcookieversioncheck@
# output configuration
availoutput := @availoutput@
availterseoutput := @availterseoutput@
listoutput := @listoutput@
listterseoutput := @listterseoutput@
# command location
TCLSH := @TCLSH@
PYTHON := @PYTHON@

85
configure vendored
View File

@@ -38,7 +38,8 @@ availindepth implicitdefault extendeddefault moduleshome initconfin pager \
pageropts verbosity color darkbgcolors lightbgcolors termbg lockedconfigs \
icase unloadmatchorder searchmatch modulepath loadedmodules quarantinevars \
wa277 advversspec ml windowssupport nearlyforbiddendays implicitrequirement \
tagabbrev tagcolorname mcookieversioncheck"
tagabbrev tagcolorname mcookieversioncheck availoutput availterseoutput \
listoutput listterseoutput"
compatarglist=
libarglist=
@@ -125,6 +126,10 @@ nearlyforbiddendays=14
tagabbrev='auto-loaded=aL:loaded=L:hidden=H:hidden-loaded=H:forbidden=F:nearly-forbidden=nF:sticky=S:super-sticky=sS'
tagcolorname=
mcookieversioncheck=y
availoutput='modulepath:alias:dirwsym:sym:tag:key'
availterseoutput='modulepath:alias:dirwsym:sym:tag'
listoutput='header:idx:sym:tag:key'
listterseoutput='header'
# git branch to use to build compat version
compatbranch='c-3.2'
@@ -335,8 +340,30 @@ Optional Packages:
applied over their name instead of over the name of
the module they are attached to. Each element in
TAGLIST is a tag name or abbreviation (elements in
TAGLIST are separated by \`:')
[$tagcolorname]
TAGLIST are separated by \`:') [$tagcolorname]
--with-avail-output=LIST
specify content to report on avail sub-command
regular output. elements accepted in LIST are:
\`modulepath', \`alias', \`dirwsym', \`sym', \`tag'
and \`key' (elements in LIST are separated by \`:')
[$availoutput]
--with-avail-terse-output=LIST
specify content to report on avail sub-command
terse output. elements accepted in LIST are:
\`modulepath', \`alias', \`dirwsym', \`sym', \`tag'
and \`key' (elements in LIST are separated by \`:')
[$availterseoutput]
--with-list-output=LIST
specify content to report on list sub-command
regular output. elements accepted in LIST are:
\`header', \`idx', \`sym', \`tag' and \`key'
(elements in LIST are separated by \`:')
[$listoutput]
--with-list-terse-output=LIST
specify content to report on list sub-command terse
output. elements accepted in LIST are: \`header',
\`idx', \`sym', \`tag' and \`key' (elements in LIST
are separated by \`:') [$listterseoutput]
--with-modulepath=PATHLIST
default modulepaths to set in default configuration
file to be enabled (each path in PATHLIST should
@@ -435,15 +462,17 @@ get_feature_value() {
# parse optional argument to find package is set or disabled
get_package_value() {
typeset val="${1#*=}"
typeset valifunset="$2"
# use fallback value 'valifunset' when no specific value given
if [ "${1//--with-/}" != "$1" ]; then
if [ "$val" = 'no' ]; then
echo ''
if [ "$val" = 'no' ] || [ "$val" = "$1" ]; then
echo "$valifunset"
else
echo "$val"
fi
else
echo ''
echo "$valifunset"
fi
}
@@ -646,6 +675,50 @@ for arg in "$@"; do
tagabbrev=$(get_package_value "$arg") ;;
--with-tag-color-name*|--without-tag-color-name)
tagcolorname=$(get_package_value "$arg") ;;
--with-avail-output*|--without-avail-output)
availoutput=$(get_package_value "$arg" "$availoutput") ;
allowedval=" modulepath alias dirwsym sym tag key " ;
ORIG_IFS=$IFS ;
IFS=: ;
for val in $availoutput; do
if [ "${allowedval// $val /}" = "$allowedval" ]; then
echo_error "Bad value '$val' set in option \`--with-avail-output', values allowed in list are:$allowedval"
fi ;
done ;
IFS=$ORIG_IFS ;;
--with-avail-terse-output*|--without-avail-terse-output)
availterseoutput=$(get_package_value "$arg" "$availterseoutput") ;
allowedval=" modulepath alias dirwsym sym tag key " ;
ORIG_IFS=$IFS ;
IFS=: ;
for val in $availterseoutput; do
if [ "${allowedval// $val /}" = "$allowedval" ]; then
echo_error "Bad value '$val' set in option \`--with-avail-terse-output', values allowed in list are:$allowedval"
fi ;
done ;
IFS=$ORIG_IFS ;;
--with-list-output*|--without-list-output)
listoutput=$(get_package_value "$arg" "$listoutput") ;
allowedval=" header idx sym tag key " ;
ORIG_IFS=$IFS ;
IFS=: ;
for val in $listoutput; do
if [ "${allowedval// $val /}" = "$allowedval" ]; then
echo_error "Bad value '$val' set in option \`--with-list-output', values allowed in list are:$allowedval"
fi ;
done ;
IFS=$ORIG_IFS ;;
--with-list-terse-output*|--without-list-terse-output)
listterseoutput=$(get_package_value "$arg" "$listterseoutput") ;
allowedval=" header idx sym tag key " ;
ORIG_IFS=$IFS ;
IFS=: ;
for val in $listterseoutput; do
if [ "${allowedval// $val /}" = "$allowedval" ]; then
echo_error "Bad value '$val' set in option \`--with-list-terse-output', 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

@@ -68,6 +68,8 @@ array set g_config_defs [list\
avail_indepth {MODULES_AVAIL_INDEPTH @availindepth@ 0 {0 1}}\
avail_report_dir_sym {{} 1 0}\
avail_report_mfile_sym {{} 1 0}\
avail_output {MODULES_AVAIL_OUTPUT {@availoutput@} 0}\
avail_terse_output {MODULES_AVAIL_TERSE_OUTPUT {@availterseoutput@} 0}\
collection_pin_version {MODULES_COLLECTION_PIN_VERSION 0 0 {0 1}}\
collection_target {MODULES_COLLECTION_TARGET <undef> 0}\
color {MODULES_COLOR @color@ 0 {never auto always} {0 1 2} initConfColor}\
@@ -79,6 +81,8 @@ array set g_config_defs [list\
ignored_dirs {{} {CVS RCS SCCS .svn .git .SYNC .sos} 0}\
implicit_requirement {MODULES_IMPLICIT_REQUIREMENT @implicitrequirement@ 0\
{0 1}}\
list_output {MODULES_LIST_OUTPUT {@listoutput@} 0}\
list_terse_output {MODULES_LIST_TERSE_OUTPUT {@listterseoutput@} 0}\
locked_configs {{} {@lockedconfigs@} 0}\
mcookie_version_check {MODULES_MCOOKIE_VERSION_CHECK\
@mcookieversioncheck@ 0 {0 1}}\

View File

@@ -86,6 +86,11 @@ set install_tagcolorname "@tagcolorname@"
set install_mcookieversioncheck "@mcookieversioncheck@"
set install_availoutput "@availoutput@"
set install_availterseoutput "@availterseoutput@"
set install_listoutput "@listoutput@"
set install_listterseoutput "@listterseoutput@"
# command location
set install_tclsh "@TCLSH@"
set install_python "@PYTHON@"