summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-05-15 00:17:05 +0100
committerLeah Rowe <leah@libreboot.org>2023-05-15 00:21:16 +0100
commitfd8b8084ee8b6785c342d16db9f49c059672e8f0 (patch)
tree8aa948c1e656a1d4d0036976158ec04625bf59e4
parentb24fbc74c36bfd5089d44e0ec3983a3fe9ef50fa (diff)
download/coreboot: simplified for loops
-rwxr-xr-xresources/scripts/download/coreboot28
1 files changed, 10 insertions, 18 deletions
diff --git a/resources/scripts/download/coreboot b/resources/scripts/download/coreboot
index 1a596fd0..f9f6bcbe 100755
--- a/resources/scripts/download/coreboot
+++ b/resources/scripts/download/coreboot
@@ -46,26 +46,20 @@ main()
printf "Downloading coreboot and (if available) applying patches\n"
+ boards=""
if [ $# -gt 0 ]; then
- for board in "${@}"; do
- rm -f resources/coreboot/*/seen
- downloadfor "${board}"
- if [ -f build_error ]; then
- break
- fi
- done
+ boards=$@
else
for board in resources/coreboot/*; do
- rm -f resources/coreboot/*/seen
- if [ ! -d "${board}/" ]; then
- continue
- fi
- downloadfor "${board##*/}"
- if [ -f build_error ]; then
- break
- fi
+ [ ! -d "${board}" ] && continue
+ boards="${boards} ${board}"
done
fi
+ for board in ${boards}; do
+ rm -f resources/coreboot/*/seen
+ downloadfor "${board}"
+ [ -f build_error ] && break
+ done
rm -f resources/coreboot/*/seen
@@ -234,9 +228,7 @@ downloadfor() {
fi
for patch in ../../resources/coreboot/${cbtree}/patches/*.patch; do
- if [ ! -f "${patch}" ]; then
- continue
- fi
+ [ ! -f "${patch}" ] && continue
git am "${patch}" || touch ../../build_error
if [ -f ../../build_error ]; then