summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-11-16 12:42:33 +0100
committerLucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de>2016-11-16 12:42:33 +0100
commit6e313cc36ef8477e7a88683fd290a17b7dfb8f7c (patch)
tree8cc5ea8f355f0280368bc7696c323b5704395acc
parent5ee71e1fa68e872833e71d770b1065a5592ed738 (diff)
downloadmidipix_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-xbuild.sh25
1 files 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;