Module Name: src Committed By: rillig Date: Tue Nov 17 20:16:44 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: directive-export-gmake.mk Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ 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.2 src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.3 --- src/usr.bin/make/unit-tests/directive-export-gmake.mk:1.2 Mon Oct 19 18:59:53 2020 +++ src/usr.bin/make/unit-tests/directive-export-gmake.mk Tue Nov 17 20:16:44 2020 @@ -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 @@ export VAR= leading spaces # 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