From 05e6c2dfaa0280dd1a098d1ade66dce389402b6a Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Mon, 14 May 2018 22:13:21 +0200 Subject: android-build: Simplify and correct This simplifies the code and uses correct quoting for variables. This also fixes the sha1-stampfile handling so that we don't build libdivecomputer every time. Signed-off-by: Anton Lundin --- packaging/android/build.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'packaging/android/build.sh') diff --git a/packaging/android/build.sh b/packaging/android/build.sh index fc4845196..7c153865e 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -366,21 +366,19 @@ if [ -e "$PREFIX/lib/libftdi1.so" ] ; then rm "$PREFIX"/lib/libftdi1.so* fi -if [ ! -f libdivecomputer-${ARCH}.SHA ] ; then - echo "" > libdivecomputer-${ARCH}.SHA -fi pushd "$SUBSURFACE_SOURCE" git submodule update --recursive popd CURRENT_SHA=$(cd "$SUBSURFACE_SOURCE"/libdivecomputer ; git describe) -PREVIOUS_SHA=$(cat libdivecomputer-${ARCH}.SHA) -if [[ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" || ! -e "$PKG_CONFIG_LIBDIR/libdivecomputer.pc" ]] ; then +PREVIOUS_SHA=$(cat "libdivecomputer-${ARCH}.SHA" 2>/dev/null || echo) +if [ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" ] || [ ! -e "$PKG_CONFIG_LIBDIR/libdivecomputer.pc" ] ; then mkdir -p libdivecomputer-build-"$ARCH" pushd libdivecomputer-build-"$ARCH" "$SUBSURFACE_SOURCE"/libdivecomputer/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared --enable-examples=no make make install popd + echo "$CURRENT_SHA" > "libdivecomputer-${ARCH}.SHA" fi if [ ! -e qt-android-cmake ] ; then -- cgit v1.2.3-70-g09d2