From fad3d20752edd48e1cb48c667e7f3e2e74a11517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 27 Sep 2015 17:10:25 +0200 Subject: Replace sed -i with perl -ni in tests This fixes an issue on OSX where the OSX make 3.81 has a bug with multilines single quoted arguments to commands: it strips the backslash and newlines entirely. This makes it impossible to use sed -i properly. Since this is the test suite, we can instead use perl -ni, which can do the same and is available and work fine on all tested platforms. --- test/core_compat.mk | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'test/core_compat.mk') diff --git a/test/core_compat.mk b/test/core_compat.mk index 62dfe93..06d5211 100644 --- a/test/core_compat.mk +++ b/test/core_compat.mk @@ -106,10 +106,7 @@ core-compat-rebar-deps: build clean-core-compat-rebar-deps $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v $i "Add Cowboy as a dependency" - $t sed -i.bak '2i\ -DEPS = cowboy\ -dep_cowboy = git https://github.com/ninenines/cowboy 1.0.0\ -' $(APP)/Makefile + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\ndep_cowboy = git https://github.com/ninenines/cowboy 1.0.0\n"}' $(APP)/Makefile $i "Run 'make rebar.config'" $t $(MAKE) -C $(APP) rebar.config $v @@ -141,9 +138,7 @@ core-compat-rebar-deps-pkg: build clean-core-compat-rebar-deps-pkg $t $(MAKE) -C $(APP) -f erlang.mk bootstrap-lib $v $i "Add Cowboy package as a dependency" - $t sed -i.bak '2i\ -DEPS = cowboy\ -' $(APP)/Makefile + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = cowboy\n"}' $(APP)/Makefile $i "Run 'make rebar.config'" $t $(MAKE) -C $(APP) rebar.config $v @@ -228,9 +223,7 @@ core-compat-rebar-pt: build clean-core-compat-rebar-pt $t echo "-module(girl)." > $(APP)/src/girl.erl $i "Add lager to the list of dependencies" - $t sed -i.bak '2i\ -DEPS = lager\ -' $(APP)/Makefile + $t perl -ni.bak -e 'print;if ($$.==1) {print "DEPS = lager\n"}' $(APP)/Makefile $i "Add the lager_transform parse_transform to ERLC_OPTS" $t echo "ERLC_OPTS += +'{parse_transform, lager_transform}'" >> $(APP)/Makefile -- cgit v1.2.3