NetBSD/usr.bin/make/unit-tests/varname-dot-shell.exp
rillig fc135022e2 make(1): replace global preserveUndefined with VARE_KEEP_UNDEF
Controlling the expansion of variable expressions using a global
variable and a VARE flag was inconsistent.

Converting the global variable into a flag had to prerequisites:

1.  The unintended duplicate variable assignment had to be fixed, as
done in parse.c 1.520 from 2020-12-27.  Without this fix, it would have
been necessary to add more flags to Var_Exists and Var_SetWithFlags, and
this would have become too complex.

2.  There had to be a unit test demonstrating that VARE_KEEP_DOLLAR only
applies to the top-level expression and is not passed to the
subexpressions, while VARE_KEEP_UNDEF applies to all subexpressions as
well.  This test is in var-op-expand.mk 1.10 from 2020-12-28, at least
for the ':@word@' modifier.  In ParseModifierPartSubst, VARE_KEEP_UNDEF
is not passed down either, in the same way.
2020-12-28 00:46:24 +00:00

33 lines
1.4 KiB
Plaintext

ParseReadLine (10): 'ORIG_SHELL:= ${.SHELL}'
Global:ORIG_SHELL =
Var_Parse: ${.SHELL} with VARE_WANTRES|VARE_KEEP_DOLLAR|VARE_KEEP_UNDEF
Global:delete .SHELL (not found)
Command:.SHELL = (details omitted)
Global:ORIG_SHELL = (details omitted)
ParseReadLine (12): '.SHELL= overwritten'
Global:.SHELL = overwritten
CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
lhs = "(details omitted)", rhs = "(details omitted)", op = !=
ParseReadLine (19): '.MAKEFLAGS: .SHELL+=appended'
ParseDoDependency(.MAKEFLAGS: .SHELL+=appended)
Ignoring append to .SHELL since it is read-only
CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
lhs = "(details omitted)", rhs = "(details omitted)", op = !=
ParseReadLine (27): '.undef .SHELL'
Global:delete .SHELL
ParseReadLine (28): '.SHELL= newly overwritten'
Global:.SHELL = newly overwritten
CondParser_Eval: ${.SHELL} != ${ORIG_SHELL}
Var_Parse: ${.SHELL} != ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
Var_Parse: ${ORIG_SHELL} with VARE_UNDEFERR|VARE_WANTRES
lhs = "(details omitted)", rhs = "(details omitted)", op = !=
ParseReadLine (33): '.MAKEFLAGS: -d0'
ParseDoDependency(.MAKEFLAGS: -d0)
Global:.MAKEFLAGS = -r -k -d cpv -d
Global:.MAKEFLAGS = -r -k -d cpv -d 0
exit status 0