summaryrefslogtreecommitdiff
path: root/resources/scripts
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-04-01 11:27:56 +0100
committerLeah Rowe <leah@libreboot.org>2023-04-01 11:27:56 +0100
commitb10bfacf67ff04e3c0853818884bb7122d5301ce (patch)
tree6e5c45fdef7ff8a0e5b72ce7318f58bf6bbb2344 /resources/scripts
parent1c2f9b54c65555fcfbc690fc2022b2987ed4bd56 (diff)
blobutil/download: make more logic top-down
Basically, I really like OpenBSD coding style, and I want to replicate this, somewhat, in shell scripts.
Diffstat (limited to 'resources/scripts')
-rwxr-xr-xresources/scripts/blobs/download9
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/scripts/blobs/download b/resources/scripts/blobs/download
index 6f9c0cf6..6c1e9e67 100755
--- a/resources/scripts/blobs/download
+++ b/resources/scripts/blobs/download
@@ -4,6 +4,7 @@
# SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
# SPDX-License-Identifier: GPL-3.0-only
+needs=""
board="${1}"
# A shorthand for each board, to avoid duplicating configs per flash size
board_short=${board%%_*mb}
@@ -57,6 +58,11 @@ done << EOF
$(eval "awk ' /\{.*${board_short}.*}{/ {flag=1;next} /\}/{flag=0} flag { print }' resources/blobs/sources")
EOF
+Main() {
+ Build_deps
+ Download_needed
+}
+
Fail(){
printf "\nERROR: $@\n"
exit 1
@@ -140,5 +146,4 @@ Extract_me(){
printf "Truncated and cleaned me output to ${_me_destination}\n"
}
-Build_deps
-Download_needed
+Main