update/project/*: unified patch handling

Handle patches by a function at include/git.sh

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2023-09-25 11:37:35 +01:00
parent cd3225d845
commit 3738ec90ec
3 changed files with 29 additions and 25 deletions
+4 -9
View File
@@ -8,6 +8,7 @@
set -u -e
. "include/err.sh"
. "include/git.sh"
_target=""
tree=""
@@ -148,16 +149,10 @@ prepare_new_tree()
err "cannot reset ${project} revision for tree, ${tree}"
git submodule update --init --checkout || \
err "cannot update ${project} submodules for tree, ${tree}"
for patch in "../../${cfgsdir}/${tree}/patches/"*.patch; do
[ -f "${patch}" ] || continue
if ! git am "${patch}"; then
git am --abort || \
err "${project}/${tree}: FAILED: git am --abort"
err "cannot patch: ${project}/${tree}"
fi
done
)
git_am_patches "${PWD}/${project}/${tree}" \
"${PWD}/${cfgsdir}/${tree}/patches" "err" || \
err "prepare_new_trees ${project}/${tree}: cannot apply patches"
}
err_rm_seen()