mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-05-07 04:58:57 +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:
@@ -17,8 +17,8 @@ python() {
|
|||||||
|
|
||||||
apply_local_src_patches() {
|
apply_local_src_patches() {
|
||||||
|
|
||||||
input_dir="${LOCAL_SRC_PATCHES_INPUT_DIR}"
|
input_dir="$1"
|
||||||
dest_dir="${LOCAL_SRC_PATCHES_DEST_DIR}"
|
dest_dir="$2"
|
||||||
|
|
||||||
if [ ! -d "$input_dir" ] ; then
|
if [ ! -d "$input_dir" ] ; then
|
||||||
bbfatal "LOCAL_SRC_PATCHES_INPUT_DIR=$input_dir not found."
|
bbfatal "LOCAL_SRC_PATCHES_INPUT_DIR=$input_dir not found."
|
||||||
@@ -32,6 +32,7 @@ apply_local_src_patches() {
|
|||||||
export QUILT_PATCHES=./patches-extra
|
export QUILT_PATCHES=./patches-extra
|
||||||
mkdir -p 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)
|
for patch in $(find $input_dir -type f -name *.patch -or -name *.diff | sort)
|
||||||
do
|
do
|
||||||
patch_basename=`basename $patch`
|
patch_basename=`basename $patch`
|
||||||
@@ -45,4 +46,8 @@ apply_local_src_patches() {
|
|||||||
fi
|
fi
|
||||||
done
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user