general cleanup in get.sh and vendor.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-26 01:30:33 +01:00
parent 18dacd4c22
commit 09b6e91803
2 changed files with 13 additions and 18 deletions
+5 -5
View File
@@ -46,7 +46,7 @@ git_prep()
_loc="$4" # $1 and $2 are gitrepo and gitrepo_backup
chkvars rev
xbmkget git "$1" "$2" "$tmpgit" "$rev" "$_patchdir"
xbget git "$1" "$2" "$tmpgit" "$rev" "$_patchdir"
if singletree "$project" || [ $# -gt 4 ]; then
dx_ fetch_submodule "$mdir/module.list"
fi
@@ -71,19 +71,19 @@ fetch_submodule()
chkvars "sub${st}" "sub${st}_bkup" "subhash"
[ "$st" = "git" ] && x_ rm -Rf "$tmpgit/$1"
eval xbmkget "$st" "\$sub$st" "\$sub${st}_bkup" "$tmpgit/$1" \
eval xbget "$st" "\$sub$st" "\$sub${st}_bkup" "$tmpgit/$1" \
"$subhash" "$mdir/${1##*/}/patches"
}
xbmkget()
xbget()
{
[ "$1" = "curl" ] || [ "$1" = "copy" ] || [ "$1" = "git" ] || \
err "Bad dlop (arg 1): xbmkget $*"
err "Bad dlop (arg 1): xbget $*"
echk="f" && [ "$1" = "git" ] && echk="d"
for url in "$2" "$3"; do
[ -n "$url" ] || err "empty URL given in: xbmkget $*"
[ -n "$url" ] || err "empty URL given in: xbget $*"
try_file "$url" "$@" || continue
eval "[ -$echk \"$4\" ] || continue"
return 0 # successful download/copy