diff options
author | Tom Rini <tom_rini@mentor.com> | 2011-03-31 10:45:57 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-04-04 14:09:59 +0100 |
commit | 4febd376ed5e64dd5e1b7050d3c970be1476441a (patch) | |
tree | 98558056d4aa4f35e11c789787c7049c16a76c29 /meta | |
parent | 9b2210c07d62364aa8d9db476dff6e748104c076 (diff) | |
download | poky-4febd376ed5e64dd5e1b7050d3c970be1476441a.tar.gz |
patch.bbclass: allow importing patches into other dirs
This is taken from openembedded.master:
commit 9d0d70da60ca8ef278916f442125d41161846f38
Author: Chris Larson <chris_larson@mentor.com>
Date: Mon Aug 23 13:03:55 2010 -0400
patch: allow importing patches into other dirs
Use the 'patchdir' flag. If relative, it's assumed to be relative to ${S}.
It creates a patchset class per patch directory, so for quilt this results i
multiple .pc/patches directories to manage each of the patchsets.
(From OE-Core rev: 01e4609ee8441c8212725fd062782313caae0708)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/patch.bbclass | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass index 80fd45f0e3..762216345a 100644 --- a/meta/classes/patch.bbclass +++ b/meta/classes/patch.bbclass | |||
@@ -31,10 +31,8 @@ python patch_do_patch() { | |||
31 | 31 | ||
32 | path = os.getenv('PATH') | 32 | path = os.getenv('PATH') |
33 | os.putenv('PATH', bb.data.getVar('PATH', d, 1)) | 33 | os.putenv('PATH', bb.data.getVar('PATH', d, 1)) |
34 | patchset = cls(s, d) | ||
35 | patchset.Clean() | ||
36 | 34 | ||
37 | resolver = rcls(patchset) | 35 | classes = {} |
38 | 36 | ||
39 | workdir = bb.data.getVar('WORKDIR', d, 1) | 37 | workdir = bb.data.getVar('WORKDIR', d, 1) |
40 | for url in src_uri: | 38 | for url in src_uri: |
@@ -117,6 +115,21 @@ python patch_do_patch() { | |||
117 | bb.note("Patch '%s' doesn't apply to revision" % pname) | 115 | bb.note("Patch '%s' doesn't apply to revision" % pname) |
118 | continue | 116 | continue |
119 | 117 | ||
118 | if "patchdir" in parm: | ||
119 | patchdir = parm["patchdir"] | ||
120 | if not os.path.isabs(patchdir): | ||
121 | patchdir = os.path.join(s, patchdir) | ||
122 | else: | ||
123 | patchdir = s | ||
124 | |||
125 | if not patchdir in classes: | ||
126 | patchset = cls(patchdir, d) | ||
127 | resolver = rcls(patchset) | ||
128 | classes[patchdir] = (patchset, resolver) | ||
129 | patchset.Clean() | ||
130 | else: | ||
131 | patchset, resolver = classes[patchdir] | ||
132 | |||
120 | bb.note("Applying patch '%s' (%s)" % (pname, oe.path.format_display(local, d))) | 133 | bb.note("Applying patch '%s' (%s)" % (pname, oe.path.format_display(local, d))) |
121 | try: | 134 | try: |
122 | patchset.Import({"file":local, "remote":url, "strippath": striplevel}, True) | 135 | patchset.Import({"file":local, "remote":url, "strippath": striplevel}, True) |