summaryrefslogtreecommitdiff
path: root/script/update/trees
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-20 04:10:50 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-20 05:03:16 +0100
commit6af65ad430ae58bac5afd0d6e12a97e5e12e9b59 (patch)
tree6fd88f362d2ea26ae78d614aa0a3043fa3ddc422 /script/update/trees
parent4e54a051ef4ae66bae402479cd4ecdc9709e44ca (diff)
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 <leah@libreboot.org>
Diffstat (limited to 'script/update/trees')
-rwxr-xr-xscript/update/trees12
1 files changed, 4 insertions, 8 deletions
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()