mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-14 15:29:35 +02:00
use the new coding style in scripts
there were stragglers left over from the last audit, and these stragglers still exist even after all the major re-factoring as of late the new style is: bsd-like coding style and error handling. verbose yet simple error handling. we use an "err" function in a way reminiscent of most C programs that you see in openbsd base (err.h) this style is very clean, resulting in readable code Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
# helper script: clean the u-boot builds
|
||||
#
|
||||
# Copyright (C) 2014, 2015, 2016, 2020 Leah Rowe <info@minifree.org>
|
||||
# Copyright (C) 2014-2016, 2020, 2023 Leah Rowe <info@minifree.org>
|
||||
# Copyright (C) 2015 Klemens Nanni <contact@autoboot.org>
|
||||
# Copyright (C) 2022 Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
||||
#
|
||||
@@ -23,17 +23,28 @@
|
||||
[ "x${DEBUG+set}" = 'xset' ] && set -v
|
||||
set -u -e
|
||||
|
||||
printf "Cleaning u-boot builds for all boards\n"
|
||||
. "include/err.sh"
|
||||
|
||||
for board in u-boot/*; do
|
||||
if [ "${board##*/}" = "u-boot" ] || [ ! -d "${board}" ]; then
|
||||
continue
|
||||
fi
|
||||
main()
|
||||
{
|
||||
printf "Cleaning u-boot builds for all boards\n"
|
||||
clean_uboot
|
||||
}
|
||||
|
||||
make -C "${board}/" distclean
|
||||
clean_uboot()
|
||||
{
|
||||
for board in u-boot/*; do
|
||||
if [ "${board##*/}" = "u-boot" ] || [ ! -d "${board}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
[ -e "${board}/.git" ] && \
|
||||
git -C "${board}" clean -fdx
|
||||
done
|
||||
make -C "${board}/" distclean || \
|
||||
err "cannot distclean u-boot dir, ${board}"
|
||||
|
||||
printf "\n\n"
|
||||
[ ! -e "${board}/.git" ] || \
|
||||
git -C "${board}" clean -fdx || \
|
||||
err "cannot clean u-boot git repo, ${board}"
|
||||
done
|
||||
}
|
||||
|
||||
main $@
|
||||
|
||||
Reference in New Issue
Block a user