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##*/}" mcfgdir="$mdir/${1##*/}"
st="" eval "`newvar st subcurl subcurl_bkup subgit subgit_bkup subhash`"
subcurl=""
subcurl_bkup=""
subgit=""
subgit_bkup=""
subhash=""
if e "$mcfgdir/module.cfg" f missing; then if e "$mcfgdir/module.cfg" f missing; then
return 0 return 0
@@ -142,7 +137,7 @@ xbget()
for url in "$2" "$3"; do for url in "$2" "$3"; do
[ -z "$url" ] && \ [ -z "$url" ] && \
err "empty URL given in" "xbget" "$@" err "empty URL given in" "xbget" "$@"
try_fetch "$url" "$@" || \ try_fetch_$1 "$url" "$@" || \
continue continue
[ -e "$4" ] && \ [ -e "$4" ] && \
return 0; : # successful download/copy return 0; : # successful download/copy
@@ -151,19 +146,6 @@ xbget()
err "failed to download file/repository" "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() try_fetch_git()
{ {
# 1st argument $1 is the current git remote being tried, # 1st argument $1 is the current git remote being tried,
@@ -193,7 +175,7 @@ try_fetch_git()
return 1; : return 1; :
} }
try_fetch_file() try_fetch_curl()
{ {
cached="file/$6" cached="file/$6"
cached="$XBMK_CACHE/$cached" cached="$XBMK_CACHE/$cached"