build/ich9utils: simplify, fix error handling

errors weren't being handled inside a subshell

Signed-off-by: Leah Rowe <leah@libreboot.org>
fsdg20230625
Leah Rowe 2023-05-20 18:32:28 +01:00
parent 93ec91e862
commit 4e2ee58ac5
1 changed files with 14 additions and 10 deletions

View File

@ -2,7 +2,7 @@
# helper script: build ich9utils # helper script: build ich9utils
# #
# Copyright (C) 2014, 2015, 2020 Leah Rowe <info@minifree.org> # Copyright (C) 2014, 2015, 2020, 2023 Leah Rowe <info@minifree.org>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@ -18,15 +18,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
# This script assumes that the current working directory is the root
# of libreboot_src or libreboot git
[ "x${DEBUG+set}" = 'xset' ] && set -v [ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e set -u -e
printf "Build ich9utils\n" main()
( {
cd "util/ich9utils/" printf "Build ich9utils\n"
make -j$(nproc) make -j$(nproc) -C "util/ich9utils" || err "make"
) }
printf "\n\n"
err()
{
printf "%s: %s\n" $0 $1
exit 1
}
main $@