get.sh: further cleanup

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-09-12 12:34:45 +01:00
parent c3e2d8c8bc
commit 446eca846e
+3 -21
View File
@@ -82,12 +82,7 @@ fetch_submodule()
{
mcfgdir="$mdir/${1##*/}"
st=""
subcurl=""
subcurl_bkup=""
subgit=""
subgit_bkup=""
subhash=""
eval "`newvar st subcurl subcurl_bkup subgit subgit_bkup subhash`"
if e "$mcfgdir/module.cfg" f missing; then
return 0
@@ -142,7 +137,7 @@ xbget()
for url in "$2" "$3"; do
[ -z "$url" ] && \
err "empty URL given in" "xbget" "$@"
try_fetch "$url" "$@" || \
try_fetch_$1 "$url" "$@" || \
continue
[ -e "$4" ] && \
return 0; : # successful download/copy
@@ -151,19 +146,6 @@ xbget()
err "failed to download file/repository" "xbget" "$@"; :
}
try_fetch()
{
if [ "$2" = "git" ]; then
if ! try_fetch_git "$@"; then
return 1
fi
else
if ! try_fetch_file "$@"; then
return 1
fi
fi
}
try_fetch_git()
{
# 1st argument $1 is the current git remote being tried,
@@ -193,7 +175,7 @@ try_fetch_git()
return 1; :
}
try_fetch_file()
try_fetch_curl()
{
cached="file/$6"
cached="$XBMK_CACHE/$cached"