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_upgrade.mk | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'test/core_upgrade.mk') diff --git a/test/core_upgrade.mk b/test/core_upgrade.mk index ec49a9f..d7b1744 100644 --- a/test/core_upgrade.mk +++ b/test/core_upgrade.mk @@ -64,9 +64,7 @@ core-upgrade-custom-repo: build clean-core-upgrade-custom-repo $i "Fork erlang.mk locally and modify it" $t git clone -q https://github.com/ninenines/erlang.mk $(APP)/alt-erlangmk-repo - $t sed -i.bak '1i\ -# Copyright (c) erlang.mk Testsuite!\ -' $(APP)/alt-erlangmk-repo/core/core.mk + $t perl -ni.bak -e 'if ($$.==1) {print "# Copyright (c) erlang.mk Testsuite!\n";print}' $(APP)/alt-erlangmk-repo/core/core.mk $t (cd $(APP)/alt-erlangmk-repo && \ git checkout -q -b test-copyright && \ git config user.email "testsuite@erlang.mk" && \ @@ -74,10 +72,7 @@ core-upgrade-custom-repo: build clean-core-upgrade-custom-repo git commit -q -a -m 'Add Testsuite copyright') $i "Point application to an alternate erlang.mk repository" - $t sed -i.bak '2i\ -ERLANG_MK_REPO = file://$(abspath $(APP)/alt-erlangmk-repo)\ -ERLANG_MK_COMMIT = test-copyright\ -' $(APP)/Makefile + $t perl -ni.bak -e 'print;if ($$.==1) {print "ERLANG_MK_REPO = file://$(abspath $(APP)/alt-erlangmk-repo)\nERLANG_MK_COMMIT = test-copyright\n"}' $(APP)/Makefile $i "Update erlang.mk" $t $(MAKE) -C $(APP) erlang-mk $v -- cgit v1.2.3