From 5053380fd000560dd61fae23e49239afd05a6483 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 13 Mar 2017 22:44:58 +0100 Subject: update-rcconf: remove Darwin hack Even on Darwin there can be a GNU compatible sed binary in the PATH. In this case we shouldn't use the BSD sed syntax. If prereq.sh detects non GNU sed it will build a GNU sed and therefore we can assume to have a GNU sed in the PATH. --- scripts/update-rcconf | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/update-rcconf b/scripts/update-rcconf index 6bde04913..5716576ca 100755 --- a/scripts/update-rcconf +++ b/scripts/update-rcconf @@ -2,14 +2,13 @@ # This file is part of the OpenADK project. OpenADK is copyrighted # material, please see the LICENCE file in the top-level directory. -os=$(uname) -if [ "$os" = "Darwin" ]; then - sed="sed -i '' -e" -else - sed="sed -i -e" -fi - topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P)) +host=$(gcc -dumpmachine) + +case :$PATH: in +(*:$topdir/host_$host/usr/bin:*) ;; +(*) export PATH=$topdir/host_$host/usr/bin:$PATH ;; +esac . $topdir/.config suffix=${ADK_TARGET_SYSTEM} @@ -58,8 +57,8 @@ for service in $(grep ^ADK_RUNTIME_START_ $topdir/.config |grep -v ADK_RUNTIME_S rcname=openssh fi if [ $mode = "m" ]; then - $sed "s#^$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf + sed -i -e "s#^$rcname=\"NO\"#$rcname=\"DAEMON\"#" $rcconf else - $sed "s#^$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf + sed -i -e "s#^$rcname=\"NO\"#$rcname=\"YES\"#" $rcconf fi done -- cgit v1.2.3