mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 14:02:52 +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:
Executable
+21
@@ -0,0 +1,21 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
|
||||
|
||||
git_am_patches()
|
||||
{
|
||||
sdir="${1}" # assumed to be absolute path
|
||||
patchdir="${2}" # ditto
|
||||
_fail="${3}"
|
||||
(
|
||||
cd "${sdir}" || \
|
||||
"${_fail}" "apply_patches: !cd \"${sdir}\""
|
||||
for patch in "${patchdir}/"*; do
|
||||
[ -L "${patch}" ] && continue
|
||||
[ -f "${patch}" ] || continue
|
||||
if ! git am "${patch}"; then
|
||||
git am --abort || "${_fail}" "${sdir}: !git am --abort"
|
||||
"${_fail}" "!git am ${patch} -> ${sdir}"
|
||||
fi
|
||||
done
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user