Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make/unit-tests make: fix TMPDIR in unit-tests



details:   https://anonhg.NetBSD.org/src/rev/4af88cfb3522
branches:  trunk
changeset: 952671:4af88cfb3522
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 14 13:24:45 2021 +0000

description:
make: fix TMPDIR in unit-tests

Combining the assignment operator ':=' with the variable modifier ':U'
on the same variable does not work as intended.  At the point where the
':U' is evaluated, the variable is guaranteed to be defined because the
code in VarAssign_EvalSubst says so.

diffstat:

 usr.bin/make/unit-tests/Makefile |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r b515594a0c6e -r 4af88cfb3522 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sun Feb 14 12:35:27 2021 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sun Feb 14 13:24:45 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.269 2021/02/06 18:26:03 sjg Exp $
+# $NetBSD: Makefile,v 1.270 2021/02/14 13:24:45 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -622,8 +622,10 @@
 .if ${.OBJDIR} != ${.CURDIR}
 # easy
 TMPDIR:=       ${.OBJDIR}/tmp
+.elif defined(TMPDIR)
+TMPDIR:=       ${TMPDIR}/uid${.MAKE.UID}
 .else
-TMPDIR:=       ${TMPDIR:U/tmp}/uid${.MAKE.UID}
+TMPDIR:=       /tmp/uid${.MAKE.UID}
 .endif
 # make sure it exists
 .if !exist(${TMPDIR})



Home | Main Index | Thread Index | Old Index