From 9c655ffebf958479338794991e6129fd94e89f81 Mon Sep 17 00:00:00 2001 From: kytv <kytv@mail.i2p> Date: Fri, 4 Jul 2014 00:41:17 +0000 Subject: [PATCH] move from cat|grep|sed to awk --- app/src/main/jniLibs/build.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/src/main/jniLibs/build.sh b/app/src/main/jniLibs/build.sh index 4d8dd0131..6e7ed5000 100755 --- a/app/src/main/jniLibs/build.sh +++ b/app/src/main/jniLibs/build.sh @@ -8,15 +8,6 @@ # uncomment to skip # exit 0 -# -# No, no no, 'realpath' is not standard unix or coreutils. -# -# Use of 'which' is pretty bad too. Since 'which' would hit anything -# with the same filename that is +x in the path, and we don't want to do that, -# we use $0 as-is, because it contains _exactly_ what we are looking for. -# -#THISDIR=$(realpath $(dirname $(which $0))) - ## works on linux and other unixes, but not osx. if [ "`uname -s`" != "Darwin" ]; then THISDIR=$(dirname $(readlink -ne $0)) @@ -37,7 +28,7 @@ I2PBASE=${1:-$THISDIR/../../../../../i2p.i2p} ROUTERJARS=$THISDIR/../../../../routerjars ## Check the local.properties file first -export NDK="$( cat $ROUTERJARS/local.properties | grep 'ndk.dir' | sed 's/^ndk.dir\s*=\s*//' )" +export NDK=$(awk -F= '/ndk\.dir/{print $2}' "$ROUTERJARS/local.properties") if [ "$NDK" == "" ]; then ## Simple fix for osx development @@ -69,7 +60,7 @@ fi # # API level, pulled from ../AndroidManifest.xml # -LEVEL=$( cat ../AndroidManifest.xml | grep 'minSdkVersion' | sed 's/^.*minSdkVersion="\([0-9]\+\)".*$/\1/' ) +LEVEL=$(awk -F\" '/minSdkVersion/{print $2}' ../AndroidManifest.xml) ARCH="arm" export SYSROOT="$NDK/platforms/android-$LEVEL/arch-$ARCH/" if [ ! -d "$SYSROOT" ]; then -- GitLab