From 8f4f0e00ec3c307599f7f27777e3e92c1f9f6e4e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 24 Aug 2023 00:30:07 +0100 Subject: 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 --- resources/scripts/build/src/for | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'resources/scripts/build/src/for') diff --git a/resources/scripts/build/src/for b/resources/scripts/build/src/for index 57459952..6945b9f9 100755 --- a/resources/scripts/build/src/for +++ b/resources/scripts/build/src/for @@ -46,8 +46,14 @@ main() [ -z "${project}" ] && err "project name not specified" [ "${project}" = "ich9utils" ] && project="util/ich9utils" - [ -d "${project}" ] || ./fetch "${project%/*}" \ - || err "Cannot download project, ${project%/*}" + handle_dependencies + run_make_command +} + +handle_dependencies() +{ + [ -d "${project}" ] || ./fetch "${project%/*}" || \ + err "Cannot download project, ${project%/*}" [ -d "${project}" ] || err "Project, ${project%/*}, not downloaded" if [ "${project}" = "uefitool" ]; then @@ -56,6 +62,10 @@ main() cmake UEFIExtract/ || err "cannot cmake UEFIExtract" ) fi +} + +run_make_command() +{ [ ! -z "${mode}" ] || \ make -C "${project}" || err "'make' failed (${project})" [ -z "${mode}" ] || \ -- cgit v1.2.1