get.sh: simplify xbget

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-09-12 11:19:42 +01:00
parent b094c60a39
commit c3e2d8c8bc
4 changed files with 14 additions and 26 deletions
+5 -17
View File
@@ -139,25 +139,13 @@ xbget()
[ "$1" != "curl" ] && [ "$1" != "copy" ] && [ "$1" != "git" ] && \
err "Bad dlop (arg 1)" "xbget" "$@"
for url in "$2" "$3"
do
if [ -z "$url" ]; then
for url in "$2" "$3"; do
[ -z "$url" ] && \
err "empty URL given in" "xbget" "$@"
elif ! try_fetch "$url" "$@"; then
try_fetch "$url" "$@" || \
continue
fi
case "$1" in
git)
[ ! -d "$4" ] && \
continue
;;
*)
[ ! -f "$4" ] && \
continue
;;
esac
return 0 # successful download/copy
[ -e "$4" ] && \
return 0; : # successful download/copy
done
err "failed to download file/repository" "xbget" "$@"; :
+1
View File
@@ -406,6 +406,7 @@ xbmk_git_init()
x_ git -c user.name="xbmk" -c user.email="xbmk@example.com" \
tag -a "$version" -m "$projectname $version" \
1>/dev/null 2>/dev/null; :
) || err "Can't initialise workdir" xbmk_git_init "$@"; :
}
-1
View File
@@ -58,7 +58,6 @@ extract_partition()
parted "${1%.zip}" 2>/dev/null | grep "ROOT-A" )
START=$(( $( echo $ROOTP | cut -f2 -d\ | tr -d "B" ) ))
SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) ))
x_ dd if="${1%.zip}" of="root-a.ext2" bs=1024 \
+8 -8
View File
@@ -60,13 +60,13 @@ release()
prep_release()
{
(
if [ "$1" != "tarball" ]; then
x_ cd "$rsrc"
[ ! -e "cache" ] && \
x_ ln -s "$XBMK_CACHE" "cache"; :
fi
if [ "$1" != "tarball" ]; then
x_ cd "$rsrc"
[ ! -e "cache" ] && \
x_ ln -s "$XBMK_CACHE" "cache"; :
fi
prep_release_$1
prep_release_$1
) || err "can't prep release $1" "prep_release" "$@"
}
@@ -105,8 +105,8 @@ prep_release_tarball()
x_ mv "$rsrc/util/sbase2" "$rsrc/util/sbase"
(
x_ cd "${rsrc%/*}"
x_ mktarball "${rsrc##*/}" "${rsrc##*/}.tar.xz"
x_ cd "${rsrc%/*}"
x_ mktarball "${rsrc##*/}" "${rsrc##*/}.tar.xz"
) || err "can't create src tarball" "prep_release_tarball" "$@"; :
}