build-package.sh: source properties.sh before handling command line arguments

Fixes problem when it is not possible to override TERMUX_ARCH set in ~/.termuxrc.
This commit is contained in:
Leonid Pliushch 2019-08-10 00:56:55 +03:00
parent 1745ea4173
commit ba62c10575
2 changed files with 6 additions and 4 deletions

View File

@ -164,6 +164,12 @@ source scripts/build/termux_step_finish_build.sh
################################################################################
TERMUX_SCRIPTDIR=$(cd "$(dirname "$0")"; pwd)
export TERMUX_SCRIPTDIR
# shellcheck source=scripts/properties.sh
. "$TERMUX_SCRIPTDIR/scripts/properties.sh"
_show_usage() {
echo "Usage: ./build-package.sh [options] PACKAGE_1 PACKAGE_2 ..."
echo
@ -237,8 +243,6 @@ while (($# > 0)); do
# Check the package to build:
TERMUX_PKG_NAME=$(basename "$1")
export TERMUX_SCRIPTDIR
TERMUX_SCRIPTDIR=$(cd "$(dirname "$0")"; pwd)
if [[ $1 == *"/"* ]]; then
# Path to directory which may be outside this repo:
if [ ! -d "$1" ]; then termux_error_exit "'$1' seems to be a path but is not a directory"; fi

View File

@ -1,6 +1,4 @@
termux_step_setup_variables() {
# shellcheck source=scripts/properties.sh
. "$TERMUX_SCRIPTDIR/scripts/properties.sh"
: "${TERMUX_MAKE_PROCESSES:="$(nproc)"}"
: "${TERMUX_TOPDIR:="$HOME/.termux-build"}"
: "${TERMUX_ARCH:="aarch64"}" # arm, aarch64, i686 or x86_64.