[Git][ghc/ghc][master] testsuite: Fix two shell quoting issues

Marge Bot gitlab at gitlab.haskell.org
Fri Dec 18 10:55:17 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
c53b38dd by Ben Gamari at 2020-12-18T05:54:56-05:00
testsuite: Fix two shell quoting issues

Fixes two ancient bugs in the testsuite driver makefiles due to
insufficient quoting. I have no idea how these went unnoticed for so
long.

Thanks to @tomjaguarpaw for testing.

- - - - -


2 changed files:

- testsuite/mk/boilerplate.mk
- testsuite/mk/test.mk


Changes:

=====================================
testsuite/mk/boilerplate.mk
=====================================
@@ -244,7 +244,7 @@ ifeq "$(ghc_config_mk)" ""
 ghc_config_mk = $(TOP)/mk/ghcconfig$(subst $(space),_,$(subst :,_,$(subst /,_,$(subst \,_,$(TEST_HC))))).mk
 
 $(ghc_config_mk) : $(TOP)/mk/ghc-config
-	$(TOP)/mk/ghc-config "$(TEST_HC)" >"$@"; if [ $$? != 0 ]; then $(RM) "$@"; exit 1; fi
+	$(TOP)/mk/ghc-config "$(TEST_HC)" >"$@"; if [ "$$?" != "0" ]; then $(RM) "$@"; exit 1; fi
 # If the ghc-config fails, remove $@, and fail
 endif
 


=====================================
testsuite/mk/test.mk
=====================================
@@ -100,9 +100,9 @@ RUNTEST_OPTS += -e "config.leading_underscore=False"
 endif
 
 GHC_PRIM_LIBDIR := $(subst library-dirs: ,,$(shell "$(GHC_PKG)" field ghc-prim library-dirs --simple-output))
-HAVE_VANILLA := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.hi ]; then echo YES; else echo NO; fi)
-HAVE_DYNAMIC := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.dyn_hi ]; then echo YES; else echo NO; fi)
-HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.p_hi ]; then echo YES; else echo NO; fi)
+HAVE_VANILLA := $(shell if [ -f "$(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.hi" ]; then echo YES; else echo NO; fi)
+HAVE_DYNAMIC := $(shell if [ -f "$(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.dyn_hi" ]; then echo YES; else echo NO; fi)
+HAVE_PROFILING := $(shell if [ -f "$(subst \,/,$(GHC_PRIM_LIBDIR))/GHC/PrimopWrappers.p_hi" ]; then echo YES; else echo NO; fi)
 HAVE_GDB := $(shell if gdb --version > /dev/null 2> /dev/null; then echo YES; else echo NO; fi)
 HAVE_READELF := $(shell if readelf --version > /dev/null 2> /dev/null; then echo YES; else echo NO; fi)
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c53b38dd5c1e38517a0c686d2aa9f8187629299c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c53b38dd5c1e38517a0c686d2aa9f8187629299c
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201218/efde7003/attachment-0001.html>


More information about the ghc-commits mailing list