From 6e313cc36ef8477e7a88683fd290a17b7dfb8f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Wed, 16 Nov 2016 12:42:33 +0100 Subject: build.sh: fix -[abt] and build variable overrides by calling source_vars() after processing arguments. --- build.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 97a7f046..f5cb4e39 100755 --- a/build.sh +++ b/build.sh @@ -10,30 +10,31 @@ for __ in subr/*.subr; do . ./${__}; done; -check_cpuinfo; source_vars; clear_env; +check_cpuinfo; while [ ${#} -gt 0 ]; do case ${1} in --c) export ARG_CLEAN=1; ;; --n) export ARG_DRYRUN=1 ARG_VERBOSE=1; ;; --N) export ARG_OFFLINE=1; ;; --t*) export ARG_TARBALL=1; [ "${1#-t.}" != "${1}" ] && TARBALL_SUFFIX=${1#-t.}; ;; --v) export ARG_VERBOSE=1; ;; --x) export ARG_XTRACE=1; set -o xtrace; ;; --a) [ -z "${2}" ] && exec cat etc/build.usage || export ARCH=${2}; shift; ;; --b) [ -z "${2}" ] && exec cat etc/build.usage || export BUILD=${2}; shift; ;; +-c) ARG_CLEAN=1; ;; +-n) ARG_DRYRUN=1 ARG_VERBOSE=1; ;; +-N) ARG_OFFLINE=1; ;; +-t*) ARG_TARBALL=1; [ "${1#-t.}" != "${1}" ] && TARBALL_SUFFIX=${1#-t.}; ;; +-v) ARG_VERBOSE=1; ;; +-x) ARG_XTRACE=1; set -o xtrace; ;; +-a) [ -z "${2}" ] && exec cat etc/build.usage || ARCH=${2}; shift; ;; +-b) [ -z "${2}" ] && exec cat etc/build.usage || BUILD=${2}; shift; ;; -r) if [ -z "${2}" ]; then exec cat build.usage; elif [ "${2%:*}" = "${2}" ]; then - export ARG_RESTART=${2}; + ARG_RESTART=${2}; else - export ARG_RESTART=${2%:*} ARG_RESTART_AT=${2#*:}; + ARG_RESTART=${2%:*}; ARG_RESTART_AT=${2#*:}; fi; shift; ;; host_toolchain|native_toolchain|runtime|lib_packages|leaf_packages|devroot|world) - export BUILD_TARGETS_META="${BUILD_TARGETS_META:+${BUILD_TARGETS_META} }${1}"; ;; + BUILD_TARGETS_META="${BUILD_TARGETS_META:+${BUILD_TARGETS_META} }${1}"; ;; *=*) set_var_unsafe "${1%%=*}" "${1#*=}"; ;; *) exec cat etc/build.usage; ;; esac; shift; done; +source_vars; clear_env; if [ -z "${BUILD_TARGETS_META}" ]; then BUILD_TARGETS_META=world; fi; -- cgit v1.2.3