summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2012-02-01 13:55:41 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-03 17:22:12 +0000
commit3b1ad76c871584bd7df0207ad4170fe65de229eb (patch)
tree5950d5950ebf7d7016cf889fc3da982b188ccb48 /meta/classes
parent4be9d8259678be81ae4246a8c162a816c29fb1dd (diff)
downloadpoky-3b1ad76c871584bd7df0207ad4170fe65de229eb.tar.gz
classes/patch: optionally return non-patch sources
commit: patch.bbclass: abstract out logic that determines patches to apply gives the ability for other clases to emit series files for use outside of a build system, or even within the build system. There are sometimes elements on the SRC_URI that while not directly applicable to patching, can be related to patching the package. For example, the yocto kernel class would like to know about these other source items on the SRC_URI to locate out of tree kernel features. This change keeps the default behaviour of returning patches, but adds the ability to request that non-patch results be returned. Additional filtering within the non-patch category, is left up to the caller of the routine. (From OE-Core rev: 41e92923a0b2fe047ecaa9f9ffb564d6069f784f) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/patch.bbclass9
1 files changed, 8 insertions, 1 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 1ea4bc5e02..31db9e372a 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -7,13 +7,17 @@ PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
7 7
8inherit terminal 8inherit terminal
9 9
10def src_patches(d): 10def src_patches(d, all = False ):
11 workdir = d.getVar('WORKDIR', True) 11 workdir = d.getVar('WORKDIR', True)
12 fetch = bb.fetch2.Fetch([], d) 12 fetch = bb.fetch2.Fetch([], d)
13 patches = [] 13 patches = []
14 sources = []
14 for url in fetch.urls: 15 for url in fetch.urls:
15 local = patch_path(url, fetch, workdir) 16 local = patch_path(url, fetch, workdir)
16 if not local: 17 if not local:
18 if all:
19 local = fetch.localpath(url)
20 sources.append(local)
17 continue 21 continue
18 22
19 urldata = fetch.ud[url] 23 urldata = fetch.ud[url]
@@ -43,6 +47,9 @@ def src_patches(d):
43 localurl = bb.encodeurl(('file', '', local, '', '', patchparm)) 47 localurl = bb.encodeurl(('file', '', local, '', '', patchparm))
44 patches.append(localurl) 48 patches.append(localurl)
45 49
50 if all:
51 return sources
52
46 return patches 53 return patches
47 54
48def patch_path(url, fetch, workdir): 55def patch_path(url, fetch, workdir):