From 292cbc484a2c1809c3cfad1f8c7b136fe507b22c Mon Sep 17 00:00:00 2001 From: Brice Fernandes Date: Wed, 4 Oct 2017 12:12:28 +0100 Subject: [PATCH] Fix other occurences of GNU-specific sed invocation --- bin/release | 6 +++--- test/Vagrantfile | 2 +- test/run-integration-tests.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/release b/bin/release index d49ca4c0..41c8bbec 100755 --- a/bin/release +++ b/bin/release @@ -88,9 +88,9 @@ build() { ## Inject the version numbers and build the distributables ## (library versions?) - sed -i "/SCRIPT_VERSION=/ c\SCRIPT_VERSION=\"$VERSION\"" ./weave - sed -i -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset.yaml - sed -i -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset-k8s-1.6.yaml + sed -i.bak "/SCRIPT_VERSION=/ c\SCRIPT_VERSION=\"$VERSION\"" ./weave + sed -i.bak -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset.yaml + sed -i.bak -e "s/:latest/:$VERSION/" -e "/imagePullPolicy: Always/d" ./prog/weave-kube/weave-daemonset-k8s-1.6.yaml make SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER if make tests; then diff --git a/test/Vagrantfile b/test/Vagrantfile index dc9b3171..b362c454 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -38,7 +38,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| host.vm.provision :shell, :inline => <> /etc/hosts # Fix the resolution errors by using 8.8.8.8 diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh index bd5afd01..26ba7c0c 100755 --- a/test/run-integration-tests.sh +++ b/test/run-integration-tests.sh @@ -175,7 +175,7 @@ function use_or_create_image() { function update_local_etc_hosts() { echo "> Updating local /etc/hosts..." # Remove old entries (if present): - for host in $1; do sudo sed -i "/$host/d" /etc/hosts; done + for host in $1; do sudo sed -i.bak "/$host/d" /etc/hosts; done # Add new entries: sudo sh -c "echo \"$2\" >> /etc/hosts" } @@ -183,7 +183,7 @@ function update_local_etc_hosts() { function upload_etc_hosts() { # Remove old entries (if present): # shellcheck disable=SC2016,SC2086 - $SSH $3 'for host in '$1'; do sudo sed -i "/$host/d" /etc/hosts; done' + $SSH $3 'for host in '$1'; do sudo sed -i.bak "/$host/d" /etc/hosts; done' # Add new entries: echo "$2" | $SSH "$3" "sudo -- sh -c \"cat >> /etc/hosts\"" }