定义了 do_patch的行为 —— 可以使用quilt git工具进行patch。
这块知道即可。
1 # Copyright (C) 2006 OpenedHand LTD
2
3 # Point to an empty file so any user's custom settings don't break things
4 QUILTRCFILE ?= "${STAGING_ETCDIR_NATIVE}/quiltrc"
5
6 PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
7
8 +-- 10 lines: There is a bug in patch 2.7.3 and earlier where index lines-----------------------------------------------------------------------------------------------------------------------------------------
18 inherit terminal
19
20 python () {
21 if d.getVar('PATCHTOOL') == 'git' and d.getVar('PATCH_COMMIT_FUNCTIONS') == '1':
22 ¦ extratasks = bb.build.tasksbetween('do_unpack', 'do_patch', d)
23 ¦ try:
24 ¦ ¦ extratasks.remove('do_unpack')
25 ¦ except ValueError:
26 ¦ ¦ # For some recipes do_unpack doesn't exist, ignore it
27 ¦ ¦ pass
28
29 ¦ d.appendVarFlag('do_patch', 'prefuncs', ' patch_task_patch_prefunc')
30 ¦ for task in extratasks:
31 ¦ ¦ d.appendVarFlag(task, 'postfuncs', ' patch_task_postfunc')
32 }
33
34 python patch_task_patch_prefunc() {
35 +-- 25 lines: Prefunc for do_patch--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
60
61 python patch_task_postfunc() {
62 +-- 22 lines: Prefunc for task functions between do_unpack and do_patch-------------------------------------------------------------------------------------------------------------------------------------------
84
85 def src_patches(d, all=False, expand=True):
86 import oe.patch
87 return oe.patch.src_patches(d, all, expand)
88
89 def should_apply(parm, d):
90 """Determine if we should apply the given patch"""
91 import oe.patch
92 return oe.patch.should_apply(parm, d)
93
94 should_apply[vardepsexclude] = "DATE SRCDATE"
95
96 python patch_do_patch() {
97 import oe.patch
98
99 +---- 63 lines: patchsetmap = {-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
162 }
163 patch_do_patch[vardepsexclude] = "PATCHRESOLVE"
164
165 addtask patch after do_unpack
166 do_patch[dirs] = "${WORKDIR}"
167 do_patch[depends] = "${PATCHDEPENDENCY}"
168
169 EXPORT_FUNCTIONS do_patch