From 5fc2e0f80f68acf2b54e34dd0d8950ea34ac0a98 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Wed, 4 Jul 2018 07:51:59 +0200 Subject: Shellcheck Code cleanup using shellcheck. Signed-off-by: Joakim Bygdell --- packaging/android/android-build-wrapper.sh | 38 +++++++++++++++--------------- packaging/android/build.sh | 20 ++++++++-------- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'packaging') diff --git a/packaging/android/android-build-wrapper.sh b/packaging/android/android-build-wrapper.sh index 3e7a7b046..ef78b293f 100755 --- a/packaging/android/android-build-wrapper.sh +++ b/packaging/android/android-build-wrapper.sh @@ -62,49 +62,49 @@ if [ "$MISSING" ] ; then fi # first we need to get the Android SDK and NDK -if [ ! -d $ANDROID_NDK ] ; then - if [ ! -f $NDK_BINARIES ] ; then - $SLOW_PROG wget -q https://dl.google.com/android/repository/$NDK_BINARIES +if [ ! -d "$ANDROID_NDK" ] ; then + if [ ! -f "$NDK_BINARIES" ] ; then + $SLOW_PROG wget -q https://dl.google.com/android/repository/"$NDK_BINARIES" fi - unzip -q $NDK_BINARIES + unzip -q "$NDK_BINARIES" fi -if [ ! -d $ANDROID_SDK/build-tools/${ANDROID_BUILDTOOLS_REVISION} ] ; then - if [ ! -d $ANDROID_SDK ] ; then - if [ ! -f $SDK_TOOLS ] ; then - $SLOW_PROG wget -q https://dl.google.com/android/repository/$SDK_TOOLS +if [ ! -d "$ANDROID_SDK"/build-tools/"${ANDROID_BUILDTOOLS_REVISION}" ] ; then + if [ ! -d "$ANDROID_SDK" ] ; then + if [ ! -f "$SDK_TOOLS" ] ; then + $SLOW_PROG wget -q https://dl.google.com/android/repository/"$SDK_TOOLS" fi - mkdir $ANDROID_SDK - pushd $ANDROID_SDK - unzip -q ../$SDK_TOOLS + mkdir "$ANDROID_SDK" + pushd "$ANDROID_SDK" + unzip -q ../"$SDK_TOOLS" yes | tools/bin/sdkmanager --licenses > /dev/null 2>&1 || echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > licenses/android-sdk-license cat licenses/android-sdk-license echo "" else - pushd $ANDROID_SDK - tools/bin/sdkmanager tools platform-tools 'platforms;'${ANDROID_PLATFORMS} 'build-tools;'${ANDROID_BUILDTOOLS_REVISION} + pushd "$ANDROID_SDK" + tools/bin/sdkmanager tools platform-tools 'platforms;'"${ANDROID_PLATFORMS}" 'build-tools;'"${ANDROID_BUILDTOOLS_REVISION}" fi popd fi # download the Qt installer including Android bits and unpack / install QT_DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_VERSION}/${LATEST_QT}/${QT_BINARIES} -if [ ! -d Qt/${LATEST_QT}/android_armv7 ] ; then +if [ ! -d Qt/"${LATEST_QT}"/android_armv7 ] ; then if [ -d Qt ] ; then # Over writing an exsisting installation stalls the installation script, # rename the exsisting Qt folder and notify then user. mv Qt Qt_OLD echo "Qt installation found, backing it up to Qt_OLD." fi - if [ ! -f ${QT_BINARIES} ] ; then - $SLOW_PROG wget -q ${QT_DOWNLOAD_URL} + if [ ! -f "${QT_BINARIES}" ] ; then + $SLOW_PROG wget -q "${QT_DOWNLOAD_URL}" fi - chmod +x ./${QT_BINARIES} - ./${QT_BINARIES} --platform minimal --script "$SUBSURFACE_SOURCE"/qt-installer-noninteractive.qs --no-force-installations + chmod +x ./"${QT_BINARIES}" + ./"${QT_BINARIES}" --platform minimal --script "$SUBSURFACE_SOURCE"/qt-installer-noninteractive.qs --no-force-installations fi # patch the cmake / Qt5.7.1 incompatibility mentioned above -sed -i 's/set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)/# set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)/' Qt/${LATEST_QT}/android_armv7/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake +sed -i 's/set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)/# set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)/' Qt/"${LATEST_QT}"/android_armv7/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake if [ ! -d subsurface/libdivecomputer/src ] ; then pushd subsurface diff --git a/packaging/android/build.sh b/packaging/android/build.sh index e7674bf84..89ea832af 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -153,7 +153,7 @@ QMAKE=$QT5_ANDROID/android_armv7/bin/qmake $QMAKE -query # build google maps plugin -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . googlemaps +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . googlemaps # find qmake QMAKE=$QT5_ANDROID/android_armv7/bin/qmake $QMAKE -query @@ -172,7 +172,7 @@ if [ ! -e "$QT_PLUGINS_PATH"/geoservices/$GOOGLEMAPS_BIN ] || [ googlemaps/.git/ popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . sqlite +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . sqlite if [ ! -e "$PKG_CONFIG_LIBDIR/sqlite3.pc" ] ; then mkdir -p sqlite-build-"$ARCH" pushd sqlite-build-"$ARCH" @@ -182,7 +182,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/sqlite3.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libxml2 +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . libxml2 if [ ! -e libxml2/configure ] ; then pushd libxml2 autoreconf --install @@ -199,7 +199,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libxml-2.0.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libxslt +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . libxslt if [ ! -e libxslt/configure ] ; then pushd libxslt autoreconf --install @@ -214,7 +214,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libxslt.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libzip +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . libzip if [ ! -e "$PKG_CONFIG_LIBDIR/libzip.pc" ] ; then mkdir -p libzip-build-"$ARCH" pushd libzip-build-"$ARCH" @@ -224,7 +224,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libzip.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . openssl +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . openssl if [ ! -e openssl-build-"$ARCH" ] ; then mv openssl openssl-build-"$ARCH" fi @@ -248,7 +248,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libssl.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libgit2 +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . libgit2 if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then # We don't want to find the HTTP_Parser package of the build host by mistake perl -pi -e 's/FIND_PACKAGE\(HTTP_Parser\)/#FIND_PACKAGE(HTTP_Parser)/' libgit2/CMakeLists.txt @@ -264,7 +264,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then -DOPENSSL_SSL_LIBRARY="$PREFIX"/lib/libssl.so \ -DOPENSSL_CRYPTO_LIBRARY="$PREFIX"/lib/libcrypto.so \ -DOPENSSL_INCLUDE_DIR="$PREFIX"/include/openssl \ - -D_OPENSSL_VERSION=${OPENSSL_VERSION} \ + -D_OPENSSL_VERSION="${OPENSSL_VERSION}" \ ../libgit2/ make make install @@ -273,7 +273,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libgit2.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libusb +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . libusb if ! grep -q libusb_set_android_open_callback libusb/libusb/libusb.h ; then # Patch in our libusb callback pushd libusb @@ -296,7 +296,7 @@ if [ ! -e "$PKG_CONFIG_LIBDIR/libusb-1.0.pc" ] ; then popd fi -${SUBSURFACE_SOURCE}/scripts/get-dep-lib.sh singleAndroid . libftdi1 +"${SUBSURFACE_SOURCE}"/scripts/get-dep-lib.sh singleAndroid . libftdi1 if [ ! -e "$PKG_CONFIG_LIBDIR/libftdi1.pc" ] && [ "$PLATFORM" != "Darwin" ] ; then mkdir -p libftdi1-build-"$ARCH" pushd libftdi1-build-"$ARCH" -- cgit v1.2.3-70-g09d2