summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-08-23 13:03:55 -0400
committerChris Larson <chris_larson@mentor.com>2010-08-23 13:07:37 -0400
commit9d0d70da60ca8ef278916f442125d41161846f38 (patch)
treef47fa01d55c5eb3ec90fe7b0fe01f104ac590e98 /classes
parent003d07266008dd52a23b86a28d080b1473ac699b (diff)
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 in multiple .pc/patches directories to manage each of the patchsets. Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/patch.bbclass19
1 files changed, 16 insertions, 3 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index 7b0c44471a..227d7c9aeb 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -31,10 +31,8 @@ python patch_do_patch() {
path = os.getenv('PATH')
os.putenv('PATH', bb.data.getVar('PATH', d, 1))
- patchset = cls(s, d)
- patchset.Clean()
- resolver = rcls(patchset)
+ classes = {}
workdir = bb.data.getVar('WORKDIR', d, 1)
for url in src_uri:
@@ -106,6 +104,21 @@ python patch_do_patch() {
bb.note("Patch '%s' applies to earlier revisions" % pname)
continue
+ if "patchdir" in parm:
+ patchdir = parm["patchdir"]
+ if not os.path.isabs(patchdir):
+ patchdir = os.path.join(s, patchdir)
+ else:
+ patchdir = s
+
+ if not patchdir in classes:
+ patchset = cls(patchdir, d)
+ resolver = rcls(patchset)
+ classes[patchdir] = (patchset, resolver)
+ patchset.Clean()
+ else:
+ patchset, resolver = classes[patchdir]
+
bb.note("Applying patch '%s' (%s)" % (pname, oe.path.format_display(local, d)))
try:
patchset.Import({"file":local, "remote":url, "strippath": striplevel}, True)