From 446eca846e3dc4dafef51098f6959086a51999b2 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 12 Sep 2026 12:34:45 +0100 Subject: [PATCH] get.sh: further cleanup Signed-off-by: Leah Rowe --- include/get.sh | 24 +++--------------------- 1 file 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"