mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 08:40:14 +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:
@@ -24,26 +24,36 @@
|
||||
[ "x${DEBUG+set}" = 'xset' ] && set -v
|
||||
set -u -e
|
||||
|
||||
# clean coreboot utilities (dependencies for 'build'):
|
||||
. "include/err.sh"
|
||||
|
||||
printf "Cleaning the previous build of coreboot and its utilities\n"
|
||||
main()
|
||||
{
|
||||
printf "Cleaning the previous build of coreboot and its utilities\n"
|
||||
|
||||
rm -Rf cbutils
|
||||
rm -Rf cbutils || err "cannot remove cbutils/"
|
||||
[ ! -d "coreboot/" ] && exit 0
|
||||
|
||||
[ ! -d "coreboot/" ] && exit 0
|
||||
clean_cbutils
|
||||
}
|
||||
|
||||
for tree in coreboot/*; do
|
||||
[ "${tree##*/}" = "coreboot" ] && continue
|
||||
[ -d "${tree}" ] || continue
|
||||
clean_cbutils()
|
||||
{
|
||||
for tree in coreboot/*; do
|
||||
[ "${tree##*/}" = "coreboot" ] && continue
|
||||
[ -d "${tree}" ] || continue
|
||||
|
||||
# Clean coreboot, of course
|
||||
make -C "${tree}/" distclean
|
||||
# Clean coreboot, of course
|
||||
make -C "${tree}/" distclean || \
|
||||
err "cannot distclean coreboot tree, ${tree}"
|
||||
|
||||
# Clean its utilities as well
|
||||
for util in cbfstool ifdtool nvramtool cbmem; do
|
||||
make distclean -C "${tree}/util/${util}/"
|
||||
# Clean its utilities as well
|
||||
for util in cbfstool ifdtool nvramtool cbmem; do
|
||||
make distclean -C "${tree}/util/${util}/" || \
|
||||
err "cannot clean util, ${util}, at ${tree}"
|
||||
done
|
||||
make distclean -C "${tree}/payloads/libpayload/" || \
|
||||
err "cannot distclean libpayload, at ${tree}"
|
||||
done
|
||||
make distclean -C "${tree}/payloads/libpayload/"
|
||||
done
|
||||
}
|
||||
|
||||
printf "\n\n"
|
||||
main $@
|
||||
|
||||
Reference in New Issue
Block a user