From b4fbdb448d72845586623a8551ceec98e4fecd3c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 26 Sep 2025 00:12:21 +0100 Subject: 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 --- include/get.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'include') 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 -- cgit v1.2.1