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 Handle deprecation of egrep
details: https://anonhg.NetBSD.org/src/rev/71a74f0ce4ec
branches: trunk
changeset: 369946:71a74f0ce4ec
user: sjg <sjg%NetBSD.org@localhost>
date: Fri Sep 09 18:36:15 2022 +0000
description:
Handle deprecation of egrep
diffstat:
usr.bin/make/unit-tests/Makefile | 13 +++++++++++--
usr.bin/make/unit-tests/export.mk | 4 ++--
usr.bin/make/unit-tests/make-exported.mk | 4 ++--
3 files changed, 15 insertions(+), 6 deletions(-)
diffs (67 lines):
diff -r e2309f3c4a1c -r 71a74f0ce4ec usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Fri Sep 09 14:35:27 2022 +0000
+++ b/usr.bin/make/unit-tests/Makefile Fri Sep 09 18:36:15 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.324 2022/09/03 15:03:32 sjg Exp $
+# $NetBSD: Makefile,v 1.325 2022/09/09 18:36:15 sjg Exp $
#
# Unit tests for make(1)
#
@@ -673,7 +673,15 @@
_!= mkdir -p ${TMPDIR}
.endif
-MAKE_TEST_ENV= MALLOC_OPTIONS="JA" # for jemalloc 100
+# Some systems have deprecated egrep for grep -E
+# but not everyone supports that
+.if ${.MAKE.OS:NLinux} == ""
+EGREP= grep -E
+.endif
+EGREP?= egrep
+
+MAKE_TEST_ENV= EGREP="${EGREP}"
+MAKE_TEST_ENV+= MALLOC_OPTIONS="JA" # for jemalloc 100
MAKE_TEST_ENV+= MALLOC_CONF="junk:true" # for jemalloc 510
MAKE_TEST_ENV+= TMPDIR=${TMPDIR}
@@ -722,6 +730,7 @@
_SED_CMDS+= -e 's,<curdir>/,,g'
_SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g'
_SED_CMDS+= -e '/MAKE_VERSION/d'
+_SED_CMDS+= -e '/EGREP=/d'
.rawout.out:
@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \
diff -r e2309f3c4a1c -r 71a74f0ce4ec usr.bin/make/unit-tests/export.mk
--- a/usr.bin/make/unit-tests/export.mk Fri Sep 09 14:35:27 2022 +0000
+++ b/usr.bin/make/unit-tests/export.mk Fri Sep 09 18:36:15 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: export.mk,v 1.11 2021/12/05 14:57:36 rillig Exp $
+# $NetBSD: export.mk,v 1.12 2022/09/09 18:36:15 sjg Exp $
UT_TEST= export
UT_FOO= foo${BAR}
@@ -40,7 +40,7 @@
.MAKE.EXPORTED+= UT_ZOO UT_TEST
-FILTER_CMD?= egrep -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)='
+FILTER_CMD?= ${EGREP} -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)='
all:
@env | ${FILTER_CMD} | sort
diff -r e2309f3c4a1c -r 71a74f0ce4ec usr.bin/make/unit-tests/make-exported.mk
--- a/usr.bin/make/unit-tests/make-exported.mk Fri Sep 09 14:35:27 2022 +0000
+++ b/usr.bin/make/unit-tests/make-exported.mk Fri Sep 09 18:36:15 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: make-exported.mk,v 1.6 2020/10/05 19:27:48 rillig Exp $
+# $NetBSD: make-exported.mk,v 1.7 2022/09/09 18:36:15 sjg Exp $
#
# As of 2020-08-09, the code in Var_Export is shared between the .export
# directive and the .MAKE.EXPORTED variable. This leads to non-obvious
@@ -22,4 +22,4 @@
.MAKE.EXPORTED= -literal UT_VAR
all:
- @env | sort | grep -E '^UT_|make-exported-value' || true
+ @env | sort | ${EGREP} '^UT_|make-exported-value' || true
Home |
Main Index |
Thread Index |
Old Index