Module Name: src Committed By: rillig Date: Fri Dec 29 14:57:00 UTC 2023
Modified Files: src/usr.bin/make: var.c src/usr.bin/make/unit-tests: varmod-defined.exp varname-dot-suffixes.exp Log Message: make: simplify debug message for the ':@var@...@' modifier The previous variant was hard to understand. To generate a diff of this commit: cvs rdiff -u -r1.1089 -r1.1090 src/usr.bin/make/var.c cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-defined.exp cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varname-dot-suffixes.exp Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.1089 src/usr.bin/make/var.c:1.1090 --- src/usr.bin/make/var.c:1.1089 Fri Dec 29 13:25:15 2023 +++ src/usr.bin/make/var.c Fri Dec 29 14:57:00 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.1089 2023/12/29 13:25:15 rillig Exp $ */ +/* $NetBSD: var.c,v 1.1090 2023/12/29 14:57:00 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -139,7 +139,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.1089 2023/12/29 13:25:15 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.1090 2023/12/29 14:57:00 rillig Exp $"); /* * Variables are defined using one of the VAR=value assignments. Their @@ -1597,9 +1597,8 @@ ModifyWord_Loop(Substring word, SepBuf * /* TODO: handle errors */ assert(word.end[0] == '\0'); /* assume null-terminated word */ - DEBUG4(VAR, "ModifyWord_Loop: " - "in \"%s\", replace \"%s\" with \"%s\" to \"%s\"\n", - word.start, args->var, args->body, s); + DEBUG2(VAR, "ModifyWord_Loop: expand \"%s\" to \"%s\"\n", + args->body, s); if (s[0] == '\n' || Buf_EndsWith(&buf->buf, '\n')) buf->needSep = false; Index: src/usr.bin/make/unit-tests/varmod-defined.exp diff -u src/usr.bin/make/unit-tests/varmod-defined.exp:1.13 src/usr.bin/make/unit-tests/varmod-defined.exp:1.14 --- src/usr.bin/make/unit-tests/varmod-defined.exp:1.13 Tue Aug 23 19:22:01 2022 +++ src/usr.bin/make/unit-tests/varmod-defined.exp Fri Dec 29 14:57:00 2023 @@ -14,7 +14,7 @@ Modifier part: "${8_DOLLARS}" ModifyWords: split "$$$$$$$$" into 1 word Global: var = $$$$$$$$ Var_Parse: ${8_DOLLARS} (eval-keep-undefined) -ModifyWord_Loop: in "$$$$$$$$", replace "var" with "${8_DOLLARS}" to "$$$$" +ModifyWord_Loop: expand "${8_DOLLARS}" to "$$$$" Global: delete var Result of ${VAR:@var@${8_DOLLARS}@} is "$$$$" (eval-keep-dollar-and-undefined, regular) Global: VAR = $$$$ Index: src/usr.bin/make/unit-tests/varname-dot-suffixes.exp diff -u src/usr.bin/make/unit-tests/varname-dot-suffixes.exp:1.7 src/usr.bin/make/unit-tests/varname-dot-suffixes.exp:1.8 --- src/usr.bin/make/unit-tests/varname-dot-suffixes.exp:1.7 Wed Dec 20 09:03:09 2023 +++ src/usr.bin/make/unit-tests/varname-dot-suffixes.exp Fri Dec 29 14:57:00 2023 @@ -28,10 +28,10 @@ Modifier part: "${.SUFFIXES}" ModifyWords: split "1 2" into 2 words Command: ignoring '.SUFFIXES = 1' as it is read-only Var_Parse: ${.SUFFIXES} (eval-defined) -ModifyWord_Loop: in "1", replace ".SUFFIXES" with "${.SUFFIXES}" to ".c .o .1 .err .tar.gz" +ModifyWord_Loop: expand "${.SUFFIXES}" to ".c .o .1 .err .tar.gz" Command: ignoring '.SUFFIXES = 2' as it is read-only Var_Parse: ${.SUFFIXES} (eval-defined) -ModifyWord_Loop: in "2", replace ".SUFFIXES" with "${.SUFFIXES}" to ".c .o .1 .err .tar.gz" +ModifyWord_Loop: expand "${.SUFFIXES}" to ".c .o .1 .err .tar.gz" Command: ignoring delete '.SUFFIXES' as it is not found Result of ${1 2:@.SUFFIXES@${.SUFFIXES}@} is ".c .o .1 .err .tar.gz .c .o .1 .err .tar.gz" (eval-defined, defined) Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d 0 -d v -d