summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2017-03-13 21:44:58 (GMT)
committerWaldemar Brodkorb <wbx@openadk.org>2017-03-13 21:44:58 (GMT)
commit5053380fd000560dd61fae23e49239afd05a6483 (patch)
treeda8d6c31bb2e34f3d027e6292be513f018742def /scripts
parent7d5436fd25b878e60c364ea411eb2568614faffc (diff)
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-rcconf17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/update-rcconf b/scripts/update-rcconf
index 6bde049..5716576 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