Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc mk/buildlink3: increase width of varnames in show-all-bl3



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3cc4396018bc
branches:  trunk
changeset: 435122:3cc4396018bc
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Jul 01 07:39:52 2020 +0000

description:
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.

diffstat:

 mk/buildlink3/bsd.buildlink3.mk |   3 +-
 mk/misc/show.mk                 |  44 +++++++++++++-----------
 regress/show-all/spec           |  72 ++++++++++++++++++++--------------------
 3 files changed, 61 insertions(+), 58 deletions(-)

diffs (203 lines):

diff -r 14115a80f19c -r 3cc4396018bc mk/buildlink3/bsd.buildlink3.mk
--- a/mk/buildlink3/bsd.buildlink3.mk   Wed Jul 01 07:18:14 2020 +0000
+++ b/mk/buildlink3/bsd.buildlink3.mk   Wed Jul 01 07:39:52 2020 +0000
@@ -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 @@
 .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
diff -r 14115a80f19c -r 3cc4396018bc mk/misc/show.mk
--- a/mk/misc/show.mk   Wed Jul 01 07:18:14 2020 +0000
+++ b/mk/misc/show.mk   Wed Jul 01 07:39:52 2020 +0000
@@ -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 @@
 
 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-${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
+       ${RUN} printf '\n'
 .  endfor
-       ${RUN} printf '\n'
 .endfor
 
 .PHONY: show-depends-options
diff -r 14115a80f19c -r 3cc4396018bc regress/show-all/spec
--- a/regress/show-all/spec     Wed Jul 01 07:18:14 2020 +0000
+++ b/regress/show-all/spec     Wed Jul 01 07:39:52 2020 +0000
@@ -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 @@
 
        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 @@
        #
        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
 



Home | Main Index | Thread Index | Old Index