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>
btrfsvols
Leah Rowe 2023-09-25 12:00:43 +01:00
parent 3738ec90ec
commit a823bab365
1 changed files with 6 additions and 0 deletions

View File

@ -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
}