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>
This commit is contained in:
Leah Rowe
2023-10-20 04:10:50 +01:00
parent 4e54a051ef
commit 6af65ad430
5 changed files with 48 additions and 47 deletions
+4 -8
View File
@@ -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()