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(1): fix test directive-export-g...



details:   https://anonhg.NetBSD.org/src/rev/bed71de166a0
branches:  trunk
changeset: 941140:bed71de166a0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 19 18:59:53 2020 +0000

description:
make(1): fix test directive-export-gmake.mk for dash

diffstat:

 usr.bin/make/unit-tests/directive-export-gmake.mk |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r fa7335104975 -r bed71de166a0 usr.bin/make/unit-tests/directive-export-gmake.mk
--- a/usr.bin/make/unit-tests/directive-export-gmake.mk Mon Oct 19 17:47:45 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-export-gmake.mk Mon Oct 19 18:59:53 2020 +0000
@@ -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 @@
 # 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.



Home | Main Index | Thread Index | Old Index