mk/buildlink3: increase width of varnames in show-all-bl3
The buildlink3 variable names are quite long. So long that using the default column width of 24 characters, most of the variable values are not aligned. In this case, it makes sense to shift them all to the right a bit.
This commit is contained in:
parent
1deaf712fa
commit
d10b39c41d
3 changed files with 61 additions and 58 deletions
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: bsd.buildlink3.mk,v 1.244 2020/06/07 17:56:13 rillig Exp $
|
||||
# $NetBSD: bsd.buildlink3.mk,v 1.245 2020/07/01 07:39:52 rillig Exp $
|
||||
#
|
||||
# Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||
# All rights reserved.
|
||||
|
@ -204,6 +204,7 @@ _BLNK_PACKAGES+= ${_pkg_}
|
|||
.endfor
|
||||
|
||||
_VARGROUPS+= bl3
|
||||
_VARGROUPS_WIDTH.bl3= 39
|
||||
_DEF_VARS.bl3+= _BLNK_PACKAGES _BLNK_DEPENDS
|
||||
_LISTED_VARS.bl3+= _BLNK_PACKAGES _BLNK_DEPENDS
|
||||
.for v in BINDIR CFLAGS CPPFLAGS DEPENDS LDADD LDFLAGS LIBS
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: show.mk,v 1.20 2020/03/30 22:49:30 rillig Exp $
|
||||
# $NetBSD: show.mk,v 1.21 2020/07/01 07:39:52 rillig Exp $
|
||||
#
|
||||
# This file contains some targets that print information gathered from
|
||||
# variables. They do not modify any variables.
|
||||
|
@ -154,6 +154,7 @@ _LABEL._DEF_VARS= def
|
|||
|
||||
show-all: .PHONY
|
||||
.for g in ${"${.TARGETS:Mshow-all*}":?${_VARGROUPS:O:u}:}
|
||||
. for w in ${_VARGROUPS_WIDTH.${g}:U23}
|
||||
|
||||
show-all: show-all-${g}
|
||||
|
||||
|
@ -171,54 +172,55 @@ _SHOW_ALL.d8= $$$$$$$$ # see regress/show-all
|
|||
show-all-${g}: .PHONY
|
||||
@${RUN} printf '%s:\n' ${g:Q}
|
||||
|
||||
. for c in ${_SHOW_ALL_CATEGORIES}
|
||||
. for v in ${${c}.${g}}
|
||||
. for c in ${_SHOW_ALL_CATEGORIES}
|
||||
. for v in ${${c}.${g}}
|
||||
|
||||
. if ${_SORTED_VARS.${g}:U:@pattern@ ${v:M${pattern}} @:M*}
|
||||
. if ${_SORTED_VARS.${g}:U:@pattern@ ${v:M${pattern}} @:M*}
|
||||
|
||||
# multi-valued variables, values are sorted
|
||||
${RUN} \
|
||||
if ${!defined(${v}) :? true : false}; then \
|
||||
printf ' %s\t%-23s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
|
||||
printf ' %-6s%-${w}s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
|
||||
elif value=${${v}:U:M*:Q} && test "x$$value" = "x"; then \
|
||||
printf ' %s\t%-23s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf ' %-6s%-${w}s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
else \
|
||||
printf ' %s\t%-23s \\\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf '\t\t\t\t%s \\\n' ${${v}:O:C,\\$$,${_SHOW_ALL.d8},g:@x@${x:Q}@}; \
|
||||
printf '\t\t\t\t# end of %s (sorted)\n' ${v:Q}; \
|
||||
printf ' %-6s%-${w}s \\\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf ' %-${w}s %s \\\n' ${${v}:O:C,\\$$,${_SHOW_ALL.d8},g:@x@'' ${x:Q}@}; \
|
||||
printf ' %-${w}s # end of %s (sorted)\n' '' ${v:Q}; \
|
||||
fi
|
||||
|
||||
. elif ${_LISTED_VARS.${g}:U:@pattern@ ${v:M${pattern}} @:M*}
|
||||
. elif ${_LISTED_VARS.${g}:U:@pattern@ ${v:M${pattern}} @:M*}
|
||||
|
||||
# multi-valued variables, preserving original order
|
||||
${RUN} \
|
||||
if ${!defined(${v}) :? true : false}; then \
|
||||
printf ' %s\t%-23s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
|
||||
printf ' %-6s%-${w}s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
|
||||
elif value=${${v}:U:M*:Q} && test "x$$value" = "x"; then \
|
||||
printf ' %s\t%-23s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf ' %-6s%-${w}s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
else \
|
||||
printf ' %s\t%-23s \\\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf '\t\t\t\t%s \\\n' ${${v}:C,\\$$,${_SHOW_ALL.d8},g:@x@${x:Q}@}; \
|
||||
printf '\t\t\t\t# end of %s\n' ${v:Q}; \
|
||||
printf ' %-6s%-${w}s \\\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf ' %-${w}s %s \\\n' ${${v}:C,\\$$,${_SHOW_ALL.d8},g:@x@'' ${x:Q}@}; \
|
||||
printf ' %-${w}s # end of %s\n' '' ${v:Q}; \
|
||||
fi
|
||||
|
||||
. else
|
||||
. else
|
||||
|
||||
# single-valued variables
|
||||
${RUN} \
|
||||
if ${!defined(${v}) :? true : false}; then \
|
||||
printf ' %s\t%-23s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
|
||||
printf ' %-6s%-${w}s # undefined\n' ${_LABEL.${c}} ${v:Q}; \
|
||||
elif value=${${v}:U:C,\\$$,${_SHOW_ALL.d4},gW:Q} && test "x$$value" = "x"; then \
|
||||
printf ' %s\t%-23s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
printf ' %-6s%-${w}s # empty\n' ${_LABEL.${c}} ${v:Q}=; \
|
||||
else \
|
||||
case "$$value" in (*[\ \ ]) eol="# ends with space";; (*) eol=""; esac; \
|
||||
printf ' %s\t%-23s %s\n' ${_LABEL.${c}} ${v:Q}= "$$value$$eol"; \
|
||||
printf ' %-6s%-${w}s %s\n' ${_LABEL.${c}} ${v:Q}= "$$value$$eol"; \
|
||||
fi
|
||||
|
||||
. endif
|
||||
. endif
|
||||
. endfor
|
||||
. endfor
|
||||
. endfor
|
||||
${RUN} printf '\n'
|
||||
. endfor
|
||||
.endfor
|
||||
|
||||
.PHONY: show-depends-options
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: spec,v 1.4 2020/03/20 16:39:03 rillig Exp $
|
||||
# $NetBSD: spec,v 1.5 2020/07/01 07:39:52 rillig Exp $
|
||||
|
||||
tmpdir=${TMPDIR:-/tmp}/pkgsrc-show-all
|
||||
rm -rf "$tmpdir"
|
||||
|
@ -24,34 +24,34 @@ check_result() {
|
|||
|
||||
cat <<'EOF' > "$tmpdir/expected"
|
||||
regress:
|
||||
pkg REGRESS_ENV.undefined # undefined
|
||||
pkg REGRESS_ENV.empty= # empty
|
||||
pkg REGRESS_ENV.space= # empty
|
||||
pkg REGRESS_ENV.value= \
|
||||
*=all \
|
||||
VAR1=value1 \
|
||||
VAR2=`command \
|
||||
backticks` \
|
||||
execution \
|
||||
via \
|
||||
# end of REGRESS_ENV.value (sorted)
|
||||
pkg REGRESS_ARGS.undefined # undefined
|
||||
pkg REGRESS_ARGS.empty= # empty
|
||||
pkg REGRESS_ARGS.space= # empty
|
||||
pkg REGRESS_ARGS.value= \
|
||||
VAR1=value1 \
|
||||
VAR2=`command \
|
||||
execution \
|
||||
via \
|
||||
backticks` \
|
||||
*=all \
|
||||
# end of REGRESS_ARGS.value
|
||||
pkg REGRESS.undefined # undefined
|
||||
pkg REGRESS.empty= # empty
|
||||
pkg REGRESS.space= # ends with space
|
||||
pkg REGRESS.value= All * kinds of `strange' \escape $$characters
|
||||
pkg *= show-all-regress
|
||||
pkg **= asterisk
|
||||
pkg REGRESS_ENV.undefined # undefined
|
||||
pkg REGRESS_ENV.empty= # empty
|
||||
pkg REGRESS_ENV.space= # empty
|
||||
pkg REGRESS_ENV.value= \
|
||||
*=all \
|
||||
VAR1=value1 \
|
||||
VAR2=`command \
|
||||
backticks` \
|
||||
execution \
|
||||
via \
|
||||
# end of REGRESS_ENV.value (sorted)
|
||||
pkg REGRESS_ARGS.undefined # undefined
|
||||
pkg REGRESS_ARGS.empty= # empty
|
||||
pkg REGRESS_ARGS.space= # empty
|
||||
pkg REGRESS_ARGS.value= \
|
||||
VAR1=value1 \
|
||||
VAR2=`command \
|
||||
execution \
|
||||
via \
|
||||
backticks` \
|
||||
*=all \
|
||||
# end of REGRESS_ARGS.value
|
||||
pkg REGRESS.undefined # undefined
|
||||
pkg REGRESS.empty= # empty
|
||||
pkg REGRESS.space= # ends with space
|
||||
pkg REGRESS.value= All * kinds of `strange' \escape $$characters
|
||||
pkg *= show-all-regress
|
||||
pkg **= asterisk
|
||||
|
||||
EOF
|
||||
|
||||
|
@ -76,13 +76,13 @@ EOF
|
|||
#
|
||||
cat <<'EOF' > "$tmpdir/expected"
|
||||
shellvar:
|
||||
pkg SHELLVAR_PLAIN= "$$var $${var} $$other $$$$"
|
||||
pkg SHELLVAR_ENV= \
|
||||
"$$var $${var} $$other $$$$" \
|
||||
# end of SHELLVAR_ENV (sorted)
|
||||
pkg SHELLVAR_ARGS= \
|
||||
"$$var $${var} $$other $$$$" \
|
||||
# end of SHELLVAR_ARGS
|
||||
pkg SHELLVAR_PLAIN= "$$var $${var} $$other $$$$"
|
||||
pkg SHELLVAR_ENV= \
|
||||
"$$var $${var} $$other $$$$" \
|
||||
# end of SHELLVAR_ENV (sorted)
|
||||
pkg SHELLVAR_ARGS= \
|
||||
"$$var $${var} $$other $$$$" \
|
||||
# end of SHELLVAR_ARGS
|
||||
|
||||
EOF
|
||||
|
||||
|
|
Loading…
Reference in a new issue