From 0a195fe88c09f6f13f761f7a53cf8926356897eb Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Mon, 25 Jun 2018 10:01:20 -0400 Subject: [PATCH 1/2] Try a different way of doing x-platform in place sed --- build-support/functions/00-vars.sh | 2 -- build-support/functions/10-util.sh | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index 517d078032..0eb2dcf109 100644 --- a/build-support/functions/00-vars.sh +++ b/build-support/functions/00-vars.sh @@ -32,10 +32,8 @@ CONSUL_PKG_NAME="consul" if test "$(uname)" == "Darwin" then SED_EXT="-E" - alias sed_i="sed -i ''" else SED_EXT="" - alias sed_i="sed -i" fi CONSUL_BINARY_TYPE=oss diff --git a/build-support/functions/10-util.sh b/build-support/functions/10-util.sh index f3cc2909e5..1de0b949fb 100644 --- a/build-support/functions/10-util.sh +++ b/build-support/functions/10-util.sh @@ -58,6 +58,17 @@ function debug { fi } +function sed_i { + if test "$(uname)" == "Darwin" + then + sed -i '' "$@" + return $? + else + sed -i "$@" + return $? + fi +} + function is_set { # Arguments: # $1 - string value to check its truthiness From b43a763c74262af0538ace643b43987d9a9f1efc Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Mon, 25 Jun 2018 10:19:02 -0400 Subject: [PATCH 2/2] sed extended regex on linux sometimes requires -r --- build-support/functions/00-vars.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-support/functions/00-vars.sh b/build-support/functions/00-vars.sh index 0eb2dcf109..a26279b892 100644 --- a/build-support/functions/00-vars.sh +++ b/build-support/functions/00-vars.sh @@ -33,7 +33,7 @@ if test "$(uname)" == "Darwin" then SED_EXT="-E" else - SED_EXT="" + SED_EXT="-r" fi CONSUL_BINARY_TYPE=oss