summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-09-26 00:12:21 +0100
committerLeah Rowe <leah@libreboot.org>2025-09-26 00:12:21 +0100
commitb4fbdb448d72845586623a8551ceec98e4fecd3c (patch)
tree63c199dac6cf9966881ef28a997fd1f1056a5a95 /include
parente42cb4f4cd513f512397ff7a46b6174b39a9708e (diff)
get.sh: rename try_file to try_fetch
the previous function name was misleading, because this tries multiple methods including git and curl. therefore, this was renamed to match what it dose. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rw-r--r--include/get.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/get.sh b/include/get.sh
index d5be5a73..63380a2e 100644
--- a/include/get.sh
+++ b/include/get.sh
@@ -117,7 +117,7 @@ xbget()
do
if [ -z "$url" ]; then
err "empty URL given in" "xbget" "$@"
- elif ! try_file "$url" "$@"; then
+ elif ! try_fetch "$url" "$@"; then
continue
fi
@@ -139,13 +139,11 @@ xbget()
err "failed to download file/repository" "xbget" "$@"; :
}
-# TODO: this function "try_file" actually handles git as well.
-# the name is misleading. think of a better name instead.
-# TODO: try_file is also a bit messy. those eval statements can
+# TODO: try_fetch is also a bit messy. those eval statements can
# be tidied up, or eval can be dropped entirely.
# (it works much better than the old code, but it's over-engineered)
-try_file()
+try_fetch()
{
cached="file/$6"
if [ "$2" = "git" ]
@@ -187,7 +185,7 @@ try_file()
then
if [ ! -d "$5" ]; then
tmpclone "$cached" "$5" "$6" "$7" || \
- err "Can't clone final repo" "try_file" "$@"; :
+ err "Can't clone final repo" "try_fetch" "$@"; :
fi
else
if bad_checksum "$6" "$cached"; then