mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-13 14:59:34 +02:00
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:
@@ -5,13 +5,14 @@
|
||||
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
|
||||
|
||||
. "include/err.sh"
|
||||
. "include/git.sh"
|
||||
|
||||
name=""
|
||||
revision=""
|
||||
location=""
|
||||
url=""
|
||||
bkup_url=""
|
||||
tmp_dir="tmp/gitclone"
|
||||
tmp_dir="${PWD}/tmp/gitclone"
|
||||
depend=""
|
||||
|
||||
main()
|
||||
@@ -83,7 +84,8 @@ clone_project()
|
||||
git reset --hard ${revision} || \
|
||||
fail "clone_project: Cannot reset revision"
|
||||
)
|
||||
patch_project
|
||||
git_am_patches "${tmp_dir}" "${PWD}/config/${name}/patches" "fail" || \
|
||||
fail "clone_project ${location}/: cannot apply patches"
|
||||
|
||||
[ ! -d "${location}" ] || \
|
||||
rm -Rf "${location}" || \
|
||||
@@ -94,20 +96,6 @@ clone_project()
|
||||
fail "clone_project: could not copy temp file to destination"
|
||||
}
|
||||
|
||||
patch_project()
|
||||
{
|
||||
patchdir="config/${name}/patches"
|
||||
|
||||
for patchfile in "${PWD}/${patchdir}"/*.patch ; do
|
||||
[ -f "${patchfile}" ] || continue
|
||||
(
|
||||
cd "${tmp_dir}" || fail "patch_project: tmpdir unavailable"
|
||||
git am "${patchfile}" || \
|
||||
fail "patch_project: Cannot patch project: $name"
|
||||
)
|
||||
done
|
||||
}
|
||||
|
||||
fail()
|
||||
{
|
||||
for x in "${location}" "${tmp_dir}"; do
|
||||
|
||||
Reference in New Issue
Block a user