From ff7aaad158d59fa056bb998c7d4c07d5bf90f8b2 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 20 Dec 2016 20:34:57 -0500 Subject: [PATCH] build-package.sh: Try to avoid needless rebuilds --- build-package.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-package.sh b/build-package.sh index 6ee898b16..f67f2db93 100755 --- a/build-package.sh +++ b/build-package.sh @@ -567,6 +567,13 @@ if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" -a "$TERMUX_PKG_BLACKLISTED_ARCHE exit 0 fi +if [ -e "/data/data/.built-packages/$TERMUX_PKG_NAME" ]; then + if [ "`cat /data/data/.built-packages/$TERMUX_PKG_NAME`" = "$TERMUX_PKG_VERSION" ]; then + echo "$TERMUX_PKG_NAME@$TERMUX_PKG_VERSION built - skipping (rm /data/data/.built-packages/$TERMUX_PKG_NAME to force rebuild)" + exit 0 + fi +fi + echo "termux - building $1 for arch $TERMUX_ARCH..." test -t 1 && printf "\033]0;%s...\007" "$1" @@ -885,4 +892,7 @@ fi echo "termux - build of '$1' done" test -t 1 && printf "\033]0;%s - DONE\007" "$1" + +mkdir -p /data/data/.built-packages +echo "$TERMUX_PKG_VERSION" > "/data/data/.built-packages/$TERMUX_PKG_NAME" exit 0