mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-09-19 21:20:31 +02:00
get.sh: even more cleanup (simplified fetch)
fetch_submodule now contains just the right amount of eval, which means all of the eval. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+11
-31
@@ -44,12 +44,10 @@ fetch_project()
|
|||||||
|
|
||||||
clone_project()
|
clone_project()
|
||||||
{
|
{
|
||||||
if ! singletree "$project"; then
|
singletree "$project" || \
|
||||||
return 0
|
return 0
|
||||||
fi
|
|
||||||
|
|
||||||
loc="src/$project"
|
loc="src/$project"
|
||||||
|
|
||||||
[ -d "$loc" ] && \
|
[ -d "$loc" ] && \
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -81,7 +79,6 @@ git_prep()
|
|||||||
fetch_submodule()
|
fetch_submodule()
|
||||||
{
|
{
|
||||||
mcfgdir="$mdir/${1##*/}"
|
mcfgdir="$mdir/${1##*/}"
|
||||||
|
|
||||||
eval "`newvar 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
|
if e "$mcfgdir/module.cfg" f missing; then
|
||||||
@@ -90,39 +87,22 @@ fetch_submodule()
|
|||||||
. "$mcfgdir/module.cfg" || \
|
. "$mcfgdir/module.cfg" || \
|
||||||
err "Can't read '$mcfgdir/module.cfg'" "fetch_submodules" "$@"
|
err "Can't read '$mcfgdir/module.cfg'" "fetch_submodules" "$@"
|
||||||
|
|
||||||
if [ -n "$subgit" ] || [ -n "$subgit_bkup" ]; then
|
[ -n "$subgit" ] && [ -n "$subgit_bkup" ] && \
|
||||||
st="$st git"
|
st="git"
|
||||||
fi
|
[ -n "$subcurl" ] && [ -n "$subcurl_bkup" ] && \
|
||||||
if [ -n "$subcurl" ] || [ -n "$subcurl_bkup" ]; then
|
st="curl$st"
|
||||||
st="$st curl"
|
[ "$st" = "curlgit" ] && \
|
||||||
fi
|
|
||||||
|
|
||||||
st="${st# }"
|
|
||||||
[ "$st" = "git curl" ] && \
|
|
||||||
err "$mdir: git+curl defined" "fetch_submodule" "$@"
|
err "$mdir: git+curl defined" "fetch_submodule" "$@"
|
||||||
|
|
||||||
[ -z "$st" ] && \
|
[ -z "$st" ] && \
|
||||||
return 0
|
return 0
|
||||||
|
[ -z "$subhash" ] && \
|
||||||
if [ "$st" = "curl" ]; then
|
|
||||||
if [ -z "$subcurl" ] || [ -z "$subcurl_bkup" ]; then
|
|
||||||
err "subcurl/subcurl_bkup not both set" \
|
|
||||||
"fetch_submodule" "$@"
|
|
||||||
fi
|
|
||||||
elif [ -z "$subgit" ] || [ -z "$subgit_bkup" ]; then
|
|
||||||
err "subgit/subgit_bkup not both set" "fetch_submodule" "$@"
|
|
||||||
elif [ -z "$subhash" ]; then
|
|
||||||
err "subhash not set" "fetch_submodule" "$@"
|
err "subhash not set" "fetch_submodule" "$@"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$st" = "git" ]; then
|
[ "$st" = "git" ] && \
|
||||||
x_ rm -Rf "$tmpgit/$1"
|
x_ rm -Rf "$tmpgit/$1"
|
||||||
xbget "$st" "$subgit" "$subgit_bkup" "$tmpgit/$1" \
|
|
||||||
"$subhash" "$mdir/${1##*/}/patches"
|
eval "xbget \"\$st\" \"\$sub$st\" \"\$sub${st}_bkup\" \"\$tmpgit/\$1\" \
|
||||||
else
|
\"\$subhash\" \"\$mdir/\${1##*/}/patches\""
|
||||||
xbget "$st" "$subcurl" "$subcurl_bkup" "$tmpgit/$1" \
|
|
||||||
"$subhash" "$mdir/${1##*/}/patches"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: in the following functions, argument numbers are used
|
# TODO: in the following functions, argument numbers are used
|
||||||
|
|||||||
Reference in New Issue
Block a user