From 2ad51be9ccb1f0717732875edbb1bb0b33caa2a2 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Thu, 15 Mar 2018 01:24:49 +0100 Subject: [PATCH] Fix bashism in Makefile for better portability Syntax `[[ "foo" != /* ]]` is not defined by POSIX Shell Command Language. It's supported only by ksh, Bash and ZSH. Other POSIX shells, such as ash or dash, does not support it. This patch replaces this problematic syntax with simple case statement that is supported by all POSIX-sh compatible shells, including (but not limited to) ash, bash, dash, ZSH. Upstream-Issue: https://github.com/racket/racket/pull/1990 --- racket/src/Makefile.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/racket/src/Makefile.in b/racket/src/Makefile.in index 76483c1793..24c2e5aeba 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -109,11 +109,10 @@ plain-install: $(MAKE) plain-install-@MAIN_VARIANT@ install-common-first: - if [ "$(DESTDIR)" != "" ]; then \ - if [[ "$(DESTDIR)" != /* ]]; then \ - echo "expected an absolute path for DESTDIR; given: $(DESTDIR)"; exit 1; \ - fi; \ - fi + case "$(DESTDIR)" in \ + "" | /*) ;; \ + *) echo "expected an absolute path for DESTDIR; given: $(DESTDIR)"; exit 1;; \ + esac mkdir -p $(ALLDIRINFO) install-common-middle: