diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-11-16 12:42:33 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-11-16 12:42:33 +0100 |
commit | 6e313cc36ef8477e7a88683fd290a17b7dfb8f7c (patch) | |
tree | 8cc5ea8f355f0280368bc7696c323b5704395acc | |
parent | 5ee71e1fa68e872833e71d770b1065a5592ed738 (diff) | |
download | midipix_build-6e313cc36ef8477e7a88683fd290a17b7dfb8f7c.tar.bz2 midipix_build-6e313cc36ef8477e7a88683fd290a17b7dfb8f7c.tar.xz |
build.sh: fix -[abt] and build variable overrides by calling source_vars() after processing arguments.
-rwxr-xr-x | build.sh | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -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; |