Module Name: src
Committed By: rillig
Date: Mon Oct 19 18:59:53 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: directive-export-gmake.mk
Log Message:
make(1): fix test directive-export-gmake.mk for dash
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/directive-export-gmake.mk
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/unit-tests/directive-export-gmake.mk
diff -u src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.1 src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.2
--- src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.1 Fri Oct 2 20:34:59 2020
+++ src/usr.bin/make/unit-tests/directive-export-gmake.mk Mon Oct 19 18:59:53 2020
@@ -1,4 +1,4 @@
-# $NetBSD: directive-export-gmake.mk,v 1.1 2020/10/02 20:34:59 rillig Exp $
+# $NetBSD: directive-export-gmake.mk,v 1.2 2020/10/19 18:59:53 rillig Exp $
#
# Tests for the export directive (without leading dot), as in GNU make.
@@ -34,9 +34,15 @@ export VAR= leading spaces
# Contrary to the usual variable assignments, spaces are significant
# before the '=' sign and are appended to the name of the environment
# variable.
+#
+# Depending on the shell, environment variables with such exotic names
+# may be silently discarded. One such shell is dash, which is the default
+# shell on Ubuntu and Debian.
export VAR =trailing space in varname
.if ${:!env | grep trailing!} != "VAR =trailing space in varname"
-. error
+. if ${:!env | grep trailing!} != "" # for dash
+. error
+. endif
.endif
# The right-hand side of the exported variable is expanded exactly once.