Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make: avoid trailing whitespace in debug log fo...



details:   https://anonhg.NetBSD.org/src/rev/fb333dc4967a
branches:  trunk
changeset: 364465:fb333dc4967a
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Mar 26 14:34:07 2022 +0000

description:
make: avoid trailing whitespace in debug log for variables

Since trailing whitespace is invisible, describe the variable value in
words to make it visible.

diffstat:

 usr.bin/make/unit-tests/directive.exp            |   2 +-
 usr.bin/make/unit-tests/opt-debug-graph1.exp     |  10 +++++-----
 usr.bin/make/unit-tests/opt-debug-graph2.exp     |   8 ++++----
 usr.bin/make/unit-tests/opt-debug-graph3.exp     |   8 ++++----
 usr.bin/make/unit-tests/opt-debug-var.exp        |   2 +-
 usr.bin/make/unit-tests/suff-main-several.exp    |  10 +++++-----
 usr.bin/make/unit-tests/suff-transform-debug.exp |  10 +++++-----
 usr.bin/make/unit-tests/var-scope-local.exp      |   2 +-
 usr.bin/make/unit-tests/vardebug.exp             |   2 +-
 usr.bin/make/unit-tests/varmod-assign-shell.exp  |   4 ++--
 usr.bin/make/unit-tests/varmod-defined.exp       |   2 +-
 usr.bin/make/unit-tests/varmod-indirect.exp      |   2 +-
 usr.bin/make/unit-tests/varmod-shell.exp         |   2 +-
 usr.bin/make/unit-tests/varmod-sun-shell.exp     |   2 +-
 usr.bin/make/unit-tests/varname-dot-shell.exp    |   2 +-
 usr.bin/make/unit-tests/varname-dot-suffixes.exp |   4 ++--
 usr.bin/make/unit-tests/varname-empty.exp        |   2 +-
 usr.bin/make/var.c                               |  23 ++++++++++++++++++-----
 18 files changed, 55 insertions(+), 42 deletions(-)

diffs (truncated from 359 to 300 lines):

diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/directive.exp
--- a/usr.bin/make/unit-tests/directive.exp     Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/directive.exp     Sat Mar 26 14:34:07 2022 +0000
@@ -2,7 +2,7 @@
 make: "directive.mk" line 12: Unknown directive "indented"
 make: "directive.mk" line 14: Unknown directive "indented"
 make: "directive.mk" line 21: Unknown directive "info"
-Global: .info = 
+Global: .info = # (empty)
 Global: .info = value
 make: "directive.mk" line 33: :=       value
 Global: .MAKEFLAGS =  -r -k -d v -d
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/opt-debug-graph1.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph1.exp      Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph1.exp      Sat Mar 26 14:34:07 2022 +0000
@@ -16,8 +16,8 @@
 #*** Global Variables:
 .ALLTARGETS      =  all made-target made-target-no-sources made-source unmade-target unmade-sources unmade-silent-source unmade-target-no-sources
 .CURDIR          = <curdir>
-.INCLUDES        = 
-.LIBS            = 
+.INCLUDES        = # (empty)
+.LIBS            = # (empty)
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
@@ -30,12 +30,12 @@
 .MAKE.PPID       = <details omitted>
 .MAKE.UID        = <details omitted>
 .MAKEFLAGS       =  -r -k -d g1
-.MAKEOVERRIDES   = 
+.MAKEOVERRIDES   = # (empty)
 .OBJDIR          = <curdir>
 .PATH            = . <curdir>
-.TARGETS         = 
+.TARGETS         = # (empty)
 .newline         = 
-
+# (ends with space)
 MACHINE          = <details omitted>
 MACHINE_ARCH     = <details omitted>
 MAKE             = <details omitted>
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/opt-debug-graph2.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph2.exp      Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph2.exp      Sat Mar 26 14:34:07 2022 +0000
@@ -50,8 +50,8 @@
 #*** Global Variables:
 .ALLTARGETS      =  made-target error-target aborted-target aborted-target-dependency all .END
 .CURDIR          = <curdir>
-.INCLUDES        = 
-.LIBS            = 
+.INCLUDES        = # (empty)
+.LIBS            = # (empty)
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
@@ -64,12 +64,12 @@
 .MAKE.PPID       = <details omitted>
 .MAKE.UID        = <details omitted>
 .MAKEFLAGS       =  -r -k -d g2
-.MAKEOVERRIDES   = 
+.MAKEOVERRIDES   = # (empty)
 .OBJDIR          = <curdir>
 .PATH            = . <curdir>
 .TARGETS         =  all
 .newline         = 
-
+# (ends with space)
 MACHINE          = <details omitted>
 MACHINE_ARCH     = <details omitted>
 MAKE             = <details omitted>
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/opt-debug-graph3.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph3.exp      Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph3.exp      Sat Mar 26 14:34:07 2022 +0000
@@ -50,8 +50,8 @@
 #*** Global Variables:
 .ALLTARGETS      =  made-target error-target aborted-target aborted-target-dependency all .END
 .CURDIR          = <curdir>
-.INCLUDES        = 
-.LIBS            = 
+.INCLUDES        = # (empty)
+.LIBS            = # (empty)
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
@@ -64,12 +64,12 @@
 .MAKE.PPID       = <details omitted>
 .MAKE.UID        = <details omitted>
 .MAKEFLAGS       =  -r -k -d g3
-.MAKEOVERRIDES   = 
+.MAKEOVERRIDES   = # (empty)
 .OBJDIR          = <curdir>
 .PATH            = . <curdir>
 .TARGETS         =  all
 .newline         = 
-
+# (ends with space)
 MACHINE          = <details omitted>
 MACHINE_ARCH     = <details omitted>
 MAKE             = <details omitted>
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/opt-debug-var.exp
--- a/usr.bin/make/unit-tests/opt-debug-var.exp Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-var.exp Sat Mar 26 14:34:07 2022 +0000
@@ -1,5 +1,5 @@
 Global: ASSIGNED = value
-Global: SUBST = 
+Global: SUBST = # (empty)
 Global: SUBST = value
 Var_Parse: y(ASSIGNED) (eval)
 Global: .MAKEFLAGS =  -r -k -d v -d
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/suff-main-several.exp
--- a/usr.bin/make/unit-tests/suff-main-several.exp     Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/suff-main-several.exp     Sat Mar 26 14:34:07 2022 +0000
@@ -81,8 +81,8 @@
 #*** Global Variables:
 .ALLTARGETS      =  .1.2 .1.3 .1.4 next-main suff-main-several.1 suff-main-several.{2,3,4}
 .CURDIR          = <curdir>
-.INCLUDES        = 
-.LIBS            = 
+.INCLUDES        = # (empty)
+.LIBS            = # (empty)
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
@@ -95,12 +95,12 @@
 .MAKE.PPID       = <details omitted>
 .MAKE.UID        = <details omitted>
 .MAKEFLAGS       =  -r -k -d mps -d 0 -d g1
-.MAKEOVERRIDES   = 
+.MAKEOVERRIDES   = # (empty)
 .OBJDIR          = <curdir>
 .PATH            = . <curdir>
-.TARGETS         = 
+.TARGETS         = # (empty)
 .newline         = 
-
+# (ends with space)
 MACHINE          = <details omitted>
 MACHINE_ARCH     = <details omitted>
 MAKE             = <details omitted>
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/suff-transform-debug.exp
--- a/usr.bin/make/unit-tests/suff-transform-debug.exp  Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/suff-transform-debug.exp  Sat Mar 26 14:34:07 2022 +0000
@@ -7,8 +7,8 @@
 #*** Global Variables:
 .ALLTARGETS      =  all
 .CURDIR          = <curdir>
-.INCLUDES        = 
-.LIBS            = 
+.INCLUDES        = # (empty)
+.LIBS            = # (empty)
 .MAKE            = <details omitted>
 .MAKE.DEPENDFILE = <details omitted>
 .MAKE.GID        = <details omitted>
@@ -21,12 +21,12 @@
 .MAKE.PPID       = <details omitted>
 .MAKE.UID        = <details omitted>
 .MAKEFLAGS       =  -r -k -d g1
-.MAKEOVERRIDES   = 
+.MAKEOVERRIDES   = # (empty)
 .OBJDIR          = <curdir>
 .PATH            = . <curdir>
-.TARGETS         = 
+.TARGETS         = # (empty)
 .newline         = 
-
+# (ends with space)
 MACHINE          = <details omitted>
 MACHINE_ARCH     = <details omitted>
 MAKE             = <details omitted>
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/var-scope-local.exp
--- a/usr.bin/make/unit-tests/var-scope-local.exp       Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/var-scope-local.exp       Sat Mar 26 14:34:07 2022 +0000
@@ -3,7 +3,7 @@
 Var_Parse: ${.MAKE.TARGET_LOCAL_VARIABLES} (eval)
 Var_SetExpand: variable name "" expands to empty string, with value "three" - ignored
 Var_SetExpand: variable name "" expands to empty string, with value "three" - ignored
-Global: one two = 
+Global: one two = # (empty)
 Global: one two = three
 Global: .MAKEFLAGS =  -r -k -d v -d
 Global: .MAKEFLAGS =  -r -k -d v -d 0
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/vardebug.exp
--- a/usr.bin/make/unit-tests/vardebug.exp      Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/vardebug.exp      Sat Mar 26 14:34:07 2022 +0000
@@ -1,5 +1,5 @@
 Global: delete FROM_CMDLINE (not found)
-Command: FROM_CMDLINE = 
+Command: FROM_CMDLINE = # (empty)
 Global: .MAKEOVERRIDES =  FROM_CMDLINE
 Global: VAR = added
 Global: VAR = overwritten
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varmod-assign-shell.exp
--- a/usr.bin/make/unit-tests/varmod-assign-shell.exp   Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-assign-shell.exp   Sat Mar 26 14:34:07 2022 +0000
@@ -1,12 +1,12 @@
 make: "varmod-assign-shell.mk" line 27: warning: "echo output; false" returned non-zero status
-Global: _ = 
+Global: _ = # (empty)
 Var_Parse: ${ASSIGNED::!=echo output; ${:Ufalse}} (eval-keep-dollar-and-undefined)
 Evaluating modifier ${ASSIGNED::...} on value "previous" (eval-keep-dollar-and-undefined, regular)
 Modifier part: "echo output; false"
 Capturing the output of command "echo output; false"
 make: "echo output; false" returned non-zero status
 Result of ${ASSIGNED::!=echo output; ${:Ufalse}} is "" (eval-keep-dollar-and-undefined, regular)
-Global: _ = 
+Global: _ = # (empty)
 Global: .MAKEFLAGS =  -r -k -d v -d
 Global: .MAKEFLAGS =  -r -k -d v -d 0
 DIRECT=output
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varmod-defined.exp
--- a/usr.bin/make/unit-tests/varmod-defined.exp        Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-defined.exp        Sat Mar 26 14:34:07 2022 +0000
@@ -1,5 +1,5 @@
 Global: 8_DOLLARS = $$$$$$$$
-Global: VAR = 
+Global: VAR = # (empty)
 Var_Parse: ${8_DOLLARS} (eval-keep-dollar-and-undefined)
 Global: VAR = $$$$$$$$
 Var_Parse: ${VAR:D${8_DOLLARS}} (eval-keep-dollar-and-undefined)
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varmod-indirect.exp
--- a/usr.bin/make/unit-tests/varmod-indirect.exp       Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-indirect.exp       Sat Mar 26 14:34:07 2022 +0000
@@ -11,7 +11,7 @@
 make: "varmod-indirect.mk" line 157: before
 make: "varmod-indirect.mk" line 157: after
 Parsing line 166: _:=  before ${UNDEF} after
-Global: _ = 
+Global: _ = # (empty)
 Var_Parse: ${UNDEF} after (eval-keep-dollar-and-undefined)
 Global: _ = before ${UNDEF} after
 Parsing line 169: _:=  before ${UNDEF:${:US,a,a,}} after
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varmod-shell.exp
--- a/usr.bin/make/unit-tests/varmod-shell.exp  Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-shell.exp  Sat Mar 26 14:34:07 2022 +0000
@@ -1,6 +1,6 @@
 make: "echo word; false" returned non-zero status
 make: "echo word; false" returned non-zero status
-Global: _ = 
+Global: _ = # (empty)
 Var_Parse: ${:!echo word; ${:Ufalse}!} (eval-keep-dollar-and-undefined)
 Evaluating modifier ${:!...} on value "" (eval-keep-dollar-and-undefined, undefined)
 Modifier part: "echo word; false"
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varmod-sun-shell.exp
--- a/usr.bin/make/unit-tests/varmod-sun-shell.exp      Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varmod-sun-shell.exp      Sat Mar 26 14:34:07 2022 +0000
@@ -1,5 +1,5 @@
 make: "echo word; false" returned non-zero status
-Global: _ = 
+Global: _ = # (empty)
 Var_Parse: ${echo word; ${:Ufalse}:L:sh} (eval-keep-dollar-and-undefined)
 Evaluating modifier ${echo word; false:L} on value "" (eval-keep-dollar-and-undefined, undefined)
 Result of ${echo word; false:L} is "echo word; false" (eval-keep-dollar-and-undefined, defined)
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varname-dot-shell.exp
--- a/usr.bin/make/unit-tests/varname-dot-shell.exp     Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-shell.exp     Sat Mar 26 14:34:07 2022 +0000
@@ -1,5 +1,5 @@
 Parsing line 10: ORIG_SHELL:=  ${.SHELL}
-Global: ORIG_SHELL = 
+Global: ORIG_SHELL = # (empty)
 Var_Parse: ${.SHELL} (eval-keep-dollar-and-undefined)
 Global: delete .SHELL (not found)
 Command: .SHELL = (details omitted)
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varname-dot-suffixes.exp
--- a/usr.bin/make/unit-tests/varname-dot-suffixes.exp  Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-suffixes.exp  Sat Mar 26 14:34:07 2022 +0000
@@ -3,13 +3,13 @@
 Global: .MAKEFLAGS =  -r -k -d v -d 0
 Global: .SUFFIXES = set ignored (read-only)
 Global: .SUFFIXES = append ignored (read-only)
-Global: _ = 
+Global: _ = # (empty)
 Var_Parse: ${.SUFFIXES::=assign} (eval-keep-dollar-and-undefined)
 Evaluating modifier ${.SUFFIXES::...} on value ".c .o .1 .err .tar.gz" (eval-keep-dollar-and-undefined, regular)
 Modifier part: "assign"
 Global: .SUFFIXES = assign ignored (read-only)
 Result of ${.SUFFIXES::=assign} is "" (eval-keep-dollar-and-undefined, regular)
-Global: _ = 
+Global: _ = # (empty)
 Var_Parse: ${preserve:L:_=.SUFFIXES} (eval-keep-dollar-and-undefined)
 Evaluating modifier ${preserve:L} on value "" (eval-keep-dollar-and-undefined, undefined)
 Result of ${preserve:L} is "preserve" (eval-keep-dollar-and-undefined, defined)
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/unit-tests/varname-empty.exp
--- a/usr.bin/make/unit-tests/varname-empty.exp Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/unit-tests/varname-empty.exp Sat Mar 26 14:34:07 2022 +0000
@@ -2,7 +2,7 @@
 Var_SetExpand: variable name "" expands to empty string, with value "cmdline-plain" - ignored
 Global: .CURDIR = <curdir>
 Var_Parse: ${MAKE_OBJDIR_CHECK_WRITABLE} (eval)
-Global: .TARGETS = 
+Global: .TARGETS = # (empty)
 Internal: MAKEFILE = varname-empty.mk
 Global: .MAKE.MAKEFILES = varname-empty.mk
 Global: .PARSEFILE = varname-empty.mk
diff -r a9eda24fcefc -r fb333dc4967a usr.bin/make/var.c
--- a/usr.bin/make/var.c        Sat Mar 26 14:17:46 2022 +0000
+++ b/usr.bin/make/var.c        Sat Mar 26 14:34:07 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.1017 2022/03/26 14:17:46 rillig Exp $        */
+/*     $NetBSD: var.c,v 1.1018 2022/03/26 14:34:07 rillig Exp $        */



Home | Main Index | Thread Index | Old Index