aboutsummaryrefslogtreecommitdiffstats
path: root/test/core_upgrade.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-27 17:10:25 +0200
committerLoïc Hoguin <[email protected]>2015-09-27 17:10:25 +0200
commitfad3d20752edd48e1cb48c667e7f3e2e74a11517 (patch)
tree7e65c526d1823716fd4e153fbadf22b9d986f9fe /test/core_upgrade.mk
parent0f78319fd528236a0fd7d152870e77248cfc5891 (diff)
downloaderlang.mk-fad3d20752edd48e1cb48c667e7f3e2e74a11517.tar.gz
erlang.mk-fad3d20752edd48e1cb48c667e7f3e2e74a11517.tar.bz2
erlang.mk-fad3d20752edd48e1cb48c667e7f3e2e74a11517.zip
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.
Diffstat (limited to 'test/core_upgrade.mk')
-rw-r--r--test/core_upgrade.mk9
1 files changed, 2 insertions, 7 deletions
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 "[email protected]" && \
@@ -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