buildgcc: Fail if a patch failed to apply
Otherwise one could end up with what they think is a coreboot toolchain
but in fact it'd be missing some patches.
Change-Id: Ic451f7061b822d0f4b64acc9976ba81fd544e85b
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/10487
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 740a035..1f73078 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -226,8 +226,10 @@
for patch in patches/${dir}_*.patch; do
test -r $patch || continue
printf " o $(basename $patch)\n"
- $PATCH -s -N -p0 < $(echo $patch) || \
+ $PATCH -s -N -p0 < $(echo $patch) || {
printf "\n${RED}Failed $patch.${NC}\n"
+ exit 1
+ }
done
touch ${dir}/.unpack_success
)