From a823bab36529406c344bb0623a1f689570a5fa9a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 25 Sep 2023 12:00:43 +0100 Subject: include/git: support applying patch subdirectories This is done recursively, with the following rule: files first, then directories. Where all patch files are applied from within the patch directory, subdirectories (within the patch directory) are then tried in alphanumerical order. Then, within each subdirectory tried, the same rule is once again applied. This is done recursively, until every patch file is applied. The code no longer applies *.patch, but instead any file. Additionally, symlinks are avoided. Signed-off-by: Leah Rowe --- include/git.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/git.sh b/include/git.sh index f7026765..9a48023d 100755 --- a/include/git.sh +++ b/include/git.sh @@ -18,4 +18,10 @@ git_am_patches() fi done ) + for patches in "${patchdir}/"*; do + [ -L "${patches}" ] && continue + [ ! -d "${patches}" ] || \ + git_am_patches "${sdir}" "${patches}" "${_fail}" || \ + "${_fail}" "apply_patches: !${sdir}/ ${patches}/" + done } -- cgit v1.2.1