1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-05-06 16:48:54 +00:00

arm/apply_local_src_patches: allow use in multiple directories

Pull out the patch application logic so the postfunc by default scans
for patches in LOCAL_SRC_PATCHES_INPUT_DIR and applies them to
LOCAL_SRC_PATCHES_DEST_DIR as before.

This allows recipes to inherit the class and directly call
apply_local_src_patches as needed to process patches in multiple
directories.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Ross Burton
2023-09-29 16:21:19 +01:00
committed by Jon Mason
parent fd13de4f85
commit be76055bdc

View File

@@ -17,8 +17,8 @@ python() {
apply_local_src_patches() {
input_dir="${LOCAL_SRC_PATCHES_INPUT_DIR}"
dest_dir="${LOCAL_SRC_PATCHES_DEST_DIR}"
input_dir="$1"
dest_dir="$2"
if [ ! -d "$input_dir" ] ; then
bbfatal "LOCAL_SRC_PATCHES_INPUT_DIR=$input_dir not found."
@@ -32,6 +32,7 @@ apply_local_src_patches() {
export QUILT_PATCHES=./patches-extra
mkdir -p patches-extra
bbdebug 1 "Looking for patches in $input_dir"
for patch in $(find $input_dir -type f -name *.patch -or -name *.diff | sort)
do
patch_basename=`basename $patch`
@@ -45,4 +46,8 @@ apply_local_src_patches() {
fi
done
}
do_patch[postfuncs] += "apply_local_src_patches"
do_apply_local_src_patches() {
apply_local_src_patches "${LOCAL_SRC_PATCHES_INPUT_DIR}" "${LOCAL_SRC_PATCHES_DEST_DIR}"
}
do_patch[postfuncs] += "do_apply_local_src_patches"