summaryrefslogtreecommitdiff
path: root/script/update/project/trees
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-25 11:37:35 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-25 11:49:13 +0100
commit3738ec90ec1728bb805d84cd8b1a68c7c31d06e4 (patch)
tree7d8edb5f86bd026741476761f56105213598295d /script/update/project/trees
parentcd3225d84517d6fee1b75a5025362161640640ea (diff)
update/project/*: unified patch handling
Handle patches by a function at include/git.sh Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update/project/trees')
-rwxr-xr-xscript/update/project/trees13
1 files changed, 4 insertions, 9 deletions
diff --git a/script/update/project/trees b/script/update/project/trees
index 6ce53250..27418f19 100755
--- a/script/update/project/trees
+++ b/script/update/project/trees
@@ -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()