summaryrefslogtreecommitdiff
path: root/script/update
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-03 13:21:30 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-03 13:21:30 +0100
commit68e1787cec7852275b80ddf1d0d02b98c0557689 (patch)
treea0367d5d3896fe48c84d35d047861363a7e21fc3 /script/update
parent5de8eda21c61fd7e1cf6b7e4ec6c9d98dae3e365 (diff)
update/project/trees: split up main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update')
-rwxr-xr-xscript/update/project/trees18
1 files changed, 13 insertions, 5 deletions
diff --git a/script/update/project/trees b/script/update/project/trees
index b61aab22..07454077 100755
--- a/script/update/project/trees
+++ b/script/update/project/trees
@@ -19,12 +19,8 @@ main()
[ -z "${1}" ] && err "project name not specified"
project="${1}" && shift 1
- cfgsdir="config/${project}"
- [ -d "${cfgsdir}" ] || err "unsupported project name"
- targets=$(listitems "${cfgsdir}")
- [ $# -gt 0 ] && targets=$@
- [ -z "${targets}" ] && err "No targets for project: ${project}"
+ configure_targets $@
for x in ${targets}; do
x_ rm -f "${cfgsdir}/"*/seen
@@ -32,6 +28,18 @@ main()
done
}
+configure_targets()
+{
+ cfgsdir="config/${project}"
+ [ -d "${cfgsdir}" ] || err "unsupported project name"
+
+ targets=$(listitems "${cfgsdir}")
+ [ $# -gt 0 ] && targets=$@
+ [ -z "${targets}" ] || return 0
+
+ err "No targets for project: ${project}"
+}
+
download_for_target()
{
_target="${1}"