summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-09-12 12:34:45 +0100
committerLeah Rowe <leah@libreboot.org>2026-09-12 12:49:12 +0100
commit446eca846e3dc4dafef51098f6959086a51999b2 (patch)
treea9a4be3077de4f1e0073c5187e317b3bd9c052f1 /include
parentc3e2d8c8bc3dfeb1472cb28affee196ddbe2fa55 (diff)
get.sh: further cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rw-r--r--include/get.sh24
1 files changed, 3 insertions, 21 deletions
diff --git a/include/get.sh b/include/get.sh
index 862bc330..a71993a0 100644
--- a/include/get.sh
+++ b/include/get.sh
@@ -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"