summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-25 12:00:43 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-25 12:00:43 +0100
commita823bab36529406c344bb0623a1f689570a5fa9a (patch)
tree9145af289cb103eabcc0c20006c7af06113d6c1c
parent3738ec90ec1728bb805d84cd8b1a68c7c31d06e4 (diff)
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 <leah@libreboot.org>
-rwxr-xr-xinclude/git.sh6
1 files changed, 6 insertions, 0 deletions
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
}