From 6af65ad430ae58bac5afd0d6e12a97e5e12e9b59 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 20 Oct 2023 04:10:50 +0100 Subject: error handling code cleanup and fixes in some cases, use of x_ or xx_ can be error-prone, due to the way $@ is handled; commands requiring quotes, or with funny file names as arguments such as spaces in the file name, or other special characters, can make the x/xx functions break. in those cases, where x/xx must not be used, the commands use || err instead in other cases, use of x/xx is superfluous, and has been removed in some commands. Signed-off-by: Leah Rowe --- script/update/trees | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'script/update/trees') diff --git a/script/update/trees b/script/update/trees index 119586a5..a71dbec0 100755 --- a/script/update/trees +++ b/script/update/trees @@ -18,8 +18,7 @@ eval "$(setvars "" arch cfgsdir codedir config config_name crossgcc_ada mode \ main() { - while getopts f:b:m:u:c:x:s:l:n: option - do + while getopts f:b:m:u:c:x:s:l:n: option; do _f="${1}" case "${1}" in -b) : ;; @@ -38,11 +37,8 @@ main() [ -z "${_f}" ] && err "missing flag (-m/-u/-b/-c/-x/-f/-s/-l/-n)" [ -z "${project}" ] && err "project name not specified" - if [ ! -f "config/${project}/build.list" ]; then - build_projects $@ - else - build_targets $@ - fi + [ -f "config/${project}/build.list" ] && build_targets $@ && return 0 + build_projects $@ } build_projects() @@ -209,7 +205,7 @@ check_cross_compiler() fi # we *must* ensure that u-boot's build system uses crossgcc first - export PATH="$(pwd)/${cbdir}/util/crossgcc/xgcc/bin:$PATH" + export PATH="${PWD}/${cbdir}/util/crossgcc/xgcc/bin:$PATH" } check_config() -- cgit v1.2.1