get.sh: make xbmkget() easier to understand

the intent once again is that this for loop shall
return, with zero status, if success is observed.

otherwise, the loop breaks and an error is thrown.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-19 23:07:01 +01:00
parent 620c1dd6fa
commit cdc0fb49e1
+4 -2
View File
@@ -85,8 +85,10 @@ xbmkget()
echk="f" && [ "$1" = "git" ] && echk="d" echk="f" && [ "$1" = "git" ] && echk="d"
for url in "$2" "$3"; do for url in "$2" "$3"; do
[ -n "$url" ] && try_file "$url" "$@" && \ [ -n "$url" ] || continue
eval "[ -$echk \"$4\" ] && return 0" try_file "$url" "$@" || continue
eval "[ -$echk \"$4\" ] || continue"
return 0 # successful download/copy
done done
err "$1 $2 $3 $4: not downloaded"; : err "$1 $2 $3 $4: not downloaded"; :
} }