mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-20 05:36:23 +02:00
git.sh cleanup: git am handling (remove patchfail)
the patchfail variable was only needed in the old design, where git am was being handled inside a subshell, and also when we did it directly in the target directory without using a temporary directory. with the current design, we can just call err() and ditch the tmp repo Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+8
-18
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# This file is only used by update/project/trees
|
# This file is only used by update/project/trees
|
||||||
|
|
||||||
eval "$(setvars "" _target rev _xm loc url bkup_url depend patchfail)"
|
eval "$(setvars "" _target rev _xm loc url bkup_url depend)"
|
||||||
|
|
||||||
fetch_project_trees()
|
fetch_project_trees()
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,6 @@ prepare_new_tree()
|
|||||||
err "prepare_new_tree ${project}/${tree}: can't make tmpclone"
|
err "prepare_new_tree ${project}/${tree}: can't make tmpclone"
|
||||||
git_patch "$tmp_git_dir" "$PWD/$cfgsdir/$tree/patches"
|
git_patch "$tmp_git_dir" "$PWD/$cfgsdir/$tree/patches"
|
||||||
git_submodule_update "${tmp_git_dir}"
|
git_submodule_update "${tmp_git_dir}"
|
||||||
[ "${patchfail}" = "y" ] && err "PATCH FAIL"
|
|
||||||
|
|
||||||
mv "${tmp_git_dir}" "src/${project}/${tree}" || \
|
mv "${tmp_git_dir}" "src/${project}/${tree}" || \
|
||||||
err "prepare_new_tree ${project}/${tree}: can't copy tmpclone"
|
err "prepare_new_tree ${project}/${tree}: can't copy tmpclone"
|
||||||
@@ -100,7 +99,6 @@ clone_project()
|
|||||||
git clone ${bkup_url} "${tmp_git_dir}" || \
|
git clone ${bkup_url} "${tmp_git_dir}" || \
|
||||||
err "clone_project: could not download ${project}"
|
err "clone_project: could not download ${project}"
|
||||||
git_patch "${tmp_git_dir}" "${PWD}/config/${project}/patches"
|
git_patch "${tmp_git_dir}" "${PWD}/config/${project}/patches"
|
||||||
[ "${patchfail}" = "y" ] && err "PATCH FAIL"
|
|
||||||
|
|
||||||
x_ rm -Rf "${loc}"
|
x_ rm -Rf "${loc}"
|
||||||
[ "${loc}" = "${loc%/*}" ] || x_ mkdir -p "${loc%/*}"
|
[ "${loc}" = "${loc%/*}" ] || x_ mkdir -p "${loc%/*}"
|
||||||
@@ -111,7 +109,7 @@ clone_project()
|
|||||||
git_patch()
|
git_patch()
|
||||||
{
|
{
|
||||||
git -C "${1}" reset --hard ${rev} || err "!git reset ${1} <- ${rev}"
|
git -C "${1}" reset --hard ${rev} || err "!git reset ${1} <- ${rev}"
|
||||||
git_am_patches "$1" "$2" || err "git_patch $project: patch fail"
|
git_am_patches "$1" "$2" || err "git_patch $project $1 $2: patch fail"
|
||||||
[ "$project" != "coreboot" ] && [ "$project" != "u-boot" ] && \
|
[ "$project" != "coreboot" ] && [ "$project" != "u-boot" ] && \
|
||||||
git_submodule_update "${1}"; return 0
|
git_submodule_update "${1}"; return 0
|
||||||
}
|
}
|
||||||
@@ -125,20 +123,12 @@ git_submodule_update()
|
|||||||
|
|
||||||
git_am_patches()
|
git_am_patches()
|
||||||
{
|
{
|
||||||
sdir="${1}" # assumed to be absolute path
|
for _patch in "$2/"*; do
|
||||||
patchdir="${2}" # ditto
|
[ -L "$_patch" ] || [ ! -f "$_patch" ] || git -C "$1" am \
|
||||||
for patch in "${patchdir}/"*; do
|
"$_patch" || err "git_am $1 $2: !git am $_patch"; continue
|
||||||
[ -L "${patch}" ] && continue
|
|
||||||
[ -f "${patch}" ] || continue
|
|
||||||
git -C "${sdir}" am "${patch}" || patchfail="y"
|
|
||||||
[ "${patchfail}" != "y" ] && continue
|
|
||||||
git -C "$sdir" am --abort || err "$sdir: !git am --abort"
|
|
||||||
err "!git am ${patch} -> ${sdir}"
|
|
||||||
done
|
done
|
||||||
for patches in "${patchdir}/"*; do
|
for _patches in "$2/"*; do
|
||||||
[ -L "${patches}" ] && continue
|
[ ! -L "$_patches" ] && [ -d "$_patches" ] && \
|
||||||
[ ! -d "${patches}" ] && continue
|
git_am_patches "$1" "$_patches"; continue
|
||||||
git_am_patches "${sdir}" "${patches}"
|
|
||||||
done
|
done
|
||||||
[ "${patchfail}" = "y" ] && return 1; return 0
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user