From 4e2ee58ac5282b1a7d5d65a264207f512f3e4a42 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 20 May 2023 18:32:28 +0100 Subject: build/ich9utils: simplify, fix error handling errors weren't being handled inside a subshell Signed-off-by: Leah Rowe --- resources/scripts/build/module/ich9utils | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/resources/scripts/build/module/ich9utils b/resources/scripts/build/module/ich9utils index 925ed855..5473a513 100755 --- a/resources/scripts/build/module/ich9utils +++ b/resources/scripts/build/module/ich9utils @@ -2,7 +2,7 @@ # helper script: build ich9utils # -# Copyright (C) 2014, 2015, 2020 Leah Rowe +# Copyright (C) 2014, 2015, 2020, 2023 Leah Rowe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,15 +18,19 @@ # along with this program. If not, see . # -# This script assumes that the current working directory is the root -# of libreboot_src or libreboot git - [ "x${DEBUG+set}" = 'xset' ] && set -v set -u -e -printf "Build ich9utils\n" -( -cd "util/ich9utils/" -make -j$(nproc) -) -printf "\n\n" +main() +{ + printf "Build ich9utils\n" + make -j$(nproc) -C "util/ich9utils" || err "make" +} + +err() +{ + printf "%s: %s\n" $0 $1 + exit 1 +} + +main $@ -- cgit v1.2.1