mirror of https://github.com/BOINC/boinc.git
[Android] Improve buildAndroidBOINC-CI.sh
1. It is extremely inefficient to delete downloaded files and download them again for every new build 2. Allow resuming partial downloads whenever possible 3. Delete the files when passing --clean
This commit is contained in:
parent
c7f043cb0b
commit
c96d2f3ead
|
@ -112,6 +112,10 @@ if [ "${doclean}" = "yes" ]; then
|
||||||
echo "cleaning build dir"
|
echo "cleaning build dir"
|
||||||
rm -rf "${BUILD_DIR}"
|
rm -rf "${BUILD_DIR}"
|
||||||
mkdir -p "${BUILD_DIR}"
|
mkdir -p "${BUILD_DIR}"
|
||||||
|
echo "cleaning downloaded cache files"
|
||||||
|
rm -f /tmp/ndk.zip
|
||||||
|
rm -f /tmp/openssl.tgz
|
||||||
|
rm -f /tmp/curl.tgz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${silent}" = "yes" ]; then
|
if [ "${silent}" = "yes" ]; then
|
||||||
|
@ -125,20 +129,18 @@ CURL_FLAGFILE="$PREFIX/curl-${CURL_VERSION}-${arch}_done"
|
||||||
OPENSSL_FLAGFILE="$PREFIX/openssl-${OPENSSL_VERSION}-${arch}_done"
|
OPENSSL_FLAGFILE="$PREFIX/openssl-${OPENSSL_VERSION}-${arch}_done"
|
||||||
|
|
||||||
if [ ! -e "${NDK_FLAGFILE}" ]; then
|
if [ ! -e "${NDK_FLAGFILE}" ]; then
|
||||||
rm -f /tmp/ndk.zip
|
|
||||||
rm -rf "$HOME/android-ndk-r${NDK_VERSION}"
|
rm -rf "$HOME/android-ndk-r${NDK_VERSION}"
|
||||||
rm -rf "${PREFIX}/${arch}"
|
rm -rf "${PREFIX}/${arch}"
|
||||||
rm -f "${CURL_FLAGFILE}" "${OPENSSL_FLAGFILE}"
|
rm -f "${CURL_FLAGFILE}" "${OPENSSL_FLAGFILE}"
|
||||||
wget --no-verbose -O /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip
|
wget -c --no-verbose -O /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux-x86_64.zip
|
||||||
unzip -qq /tmp/ndk.zip -d $HOME
|
unzip -qq /tmp/ndk.zip -d $HOME
|
||||||
touch "${NDK_FLAGFILE}"
|
touch "${NDK_FLAGFILE}"
|
||||||
fi
|
fi
|
||||||
export NDK_ROOT=$HOME/android-ndk-r${NDK_VERSION}
|
export NDK_ROOT=$HOME/android-ndk-r${NDK_VERSION}
|
||||||
|
|
||||||
if [ ! -e "${OPENSSL_FLAGFILE}" ]; then
|
if [ ! -e "${OPENSSL_FLAGFILE}" ]; then
|
||||||
rm -f /tmp/openssl.tgz
|
|
||||||
rm -rf "$BUILD_DIR/openssl-${OPENSSL_VERSION}"
|
rm -rf "$BUILD_DIR/openssl-${OPENSSL_VERSION}"
|
||||||
wget --no-verbose -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
|
wget -c --no-verbose -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
|
||||||
tar xzf /tmp/openssl.tgz --directory=$BUILD_DIR
|
tar xzf /tmp/openssl.tgz --directory=$BUILD_DIR
|
||||||
export COMPILEOPENSSL="yes"
|
export COMPILEOPENSSL="yes"
|
||||||
touch "${OPENSSL_FLAGFILE}"
|
touch "${OPENSSL_FLAGFILE}"
|
||||||
|
@ -146,9 +148,8 @@ fi
|
||||||
export OPENSSL_SRC=$BUILD_DIR/openssl-${OPENSSL_VERSION}
|
export OPENSSL_SRC=$BUILD_DIR/openssl-${OPENSSL_VERSION}
|
||||||
|
|
||||||
if [ ! -e "${CURL_FLAGFILE}" ]; then
|
if [ ! -e "${CURL_FLAGFILE}" ]; then
|
||||||
rm -f /tmp/curl.tgz
|
|
||||||
rm -rf "$BUILD_DIR/curl-${CURL_VERSION}"
|
rm -rf "$BUILD_DIR/curl-${CURL_VERSION}"
|
||||||
wget --no-verbose -O /tmp/curl.tgz https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz
|
wget -c --no-verbose -O /tmp/curl.tgz https://curl.haxx.se/download/curl-${CURL_VERSION}.tar.gz
|
||||||
tar xzf /tmp/curl.tgz --directory=$BUILD_DIR
|
tar xzf /tmp/curl.tgz --directory=$BUILD_DIR
|
||||||
export COMPILECURL="yes"
|
export COMPILECURL="yes"
|
||||||
touch "${CURL_FLAGFILE}"
|
touch "${CURL_FLAGFILE}"
|
||||||
|
|
Loading…
Reference in New Issue