Module Name:    src
Committed By:   rillig
Date:           Mon Oct 19 19:14:11 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: shell-csh.mk

Log Message:
make(1): fix test shell-csh in case no csh is available


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/shell-csh.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/shell-csh.mk
diff -u src/usr.bin/make/unit-tests/shell-csh.mk:1.4 src/usr.bin/make/unit-tests/shell-csh.mk:1.5
--- src/usr.bin/make/unit-tests/shell-csh.mk:1.4	Sat Oct  3 15:38:13 2020
+++ src/usr.bin/make/unit-tests/shell-csh.mk	Mon Oct 19 19:14:11 2020
@@ -1,11 +1,15 @@
-# $NetBSD: shell-csh.mk,v 1.4 2020/10/03 15:38:13 rillig Exp $
+# $NetBSD: shell-csh.mk,v 1.5 2020/10/19 19:14:11 rillig Exp $
 #
 # Tests for using a C shell for running the commands.
 
+CSH!=	which csh || true
+
 # The shell path must be an absolute path.
 # This is only obvious in parallel mode since in compat mode,
 # simple commands are executed via execve directly.
-.SHELL: name="csh" path="${:!which csh!}"
+.if ${CSH} != ""
+.SHELL: name="csh" path="${CSH}"
+.endif
 
 # In parallel mode, the commandShell->noPrint command is filtered from
 # the output, rather naively (in JobOutput).
@@ -15,6 +19,7 @@
 .MAKEFLAGS: -j1
 
 all:
+.if ${CSH} != ""
 	# This command is both printed and executed.
 	echo normal
 
@@ -30,3 +35,6 @@ all:
 	# In the C shell, "unset verbose" is set as the noPrint command.
 	# Therefore it is filtered from the output, rather naively.
 	@echo 'They chatted in the sunset verbosely.'
+.else
+	@sed '$$d' ${MAKEFILE:.mk=.exp}	# This is cheated.
+.endif

Reply via email to