build-package.sh: enable offline mode when file ./build-tools/.installed is present

Once ./scripts/setup-offline-bundle.sh was executed, all sources and build tools
should be downloaded and build-package.sh should be able to use them.
This commit is contained in:
Leonid Pliushch 2020-10-23 01:57:33 +03:00
parent f1d0cbc055
commit 47eca5ed01
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,13 @@ cd "$(realpath "$(dirname "$0")")"
TERMUX_SCRIPTDIR=$(pwd) TERMUX_SCRIPTDIR=$(pwd)
export TERMUX_SCRIPTDIR export TERMUX_SCRIPTDIR
# Automatically enable offline set of sources and build tools.
# Offline termux-packages bundle can be created by executing
# script ./scripts/setup-offline-bundle.sh.
if [ -f "${TERMUX_SCRIPTDIR}/build-tools/.installed" ]; then
export TERMUX_PACKAGES_OFFLINE=true
fi
# Lock file to prevent parallel running in the same environment. # Lock file to prevent parallel running in the same environment.
TERMUX_BUILD_LOCK_FILE="${TMPDIR}/.termux-build.lck" TERMUX_BUILD_LOCK_FILE="${TMPDIR}/.termux-build.lck"
if [ ! -e "$TERMUX_BUILD_LOCK_FILE" ]; then if [ ! -e "$TERMUX_BUILD_LOCK_FILE" ]; then

View File

@ -96,3 +96,6 @@ for p in "$TERMUX_SCRIPTDIR"/packages/*; do
fi fi
) )
done done
# Mark to tell build-package.sh to enable offline mode.
touch "$TERMUX_SCRIPTDIR"/build-tools/.installed