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/854b505c6a67
branches:  trunk
changeset: 946134:854b505c6a67
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Nov 17 20:16:44 2020 +0000

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

Dash only accepts environment variables whose names follow the usual
naming conventions.  (I didn't look up the exact details.)  In
particular, it rejects environment variables whose names start or end
with spaces.

This would result in an empty output from grep, in which case the exit
status from the shell command is non-zero, thus make prints an error
about this.  This error message should not appear in the test output, to
keep the test output the same for all platforms.

diffstat:

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

diffs (20 lines):

diff -r 0a0dd4ac3e29 -r 854b505c6a67 usr.bin/make/unit-tests/directive-export-gmake.mk
--- a/usr.bin/make/unit-tests/directive-export-gmake.mk Tue Nov 17 20:11:02 2020 +0000
+++ b/usr.bin/make/unit-tests/directive-export-gmake.mk Tue Nov 17 20:16:44 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: directive-export-gmake.mk,v 1.2 2020/10/19 18:59:53 rillig Exp $
+# $NetBSD: directive-export-gmake.mk,v 1.3 2020/11/17 20:16:44 rillig Exp $
 #
 # Tests for the export directive (without leading dot), as in GNU make.
 
@@ -39,8 +39,8 @@
 # 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"
-.  if ${:!env | grep trailing!} != "" # for dash
+.if ${:!env | grep trailing || true!} != "VAR =trailing space in varname"
+.  if ${:!env | grep trailing || true!} != "" # for dash
 .    error
 .  endif
 .endif



Home | Main Index | Thread Index | Old Index