summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-07 17:16:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-28 15:27:10 +0100
commit8d3c899e0a15840c54de26d2f1fc552430517778 (patch)
tree3b352db5983dcb1db9bd619367e5322bd0aee69e
parent664b85742d1afc94b291a85fd245abebffacdf3d (diff)
downloadbitbake-8d3c899e0a15840c54de26d2f1fc552430517778.tar.gz
bitbake/ast: Add optional argument for BBCLASSEXTEND
Add an optional argument to BBCLASSEXTEND entries which gets passed to the extention class as BBEXTENDVARIANT. Also add BBEXTENDCURR whic is set to the current extension class name. This mode functions slightly differently to the previous BBCLASSEXTEND code in that PN is not changed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/parse/ast.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index bf70ad265..e41bb74f4 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -427,13 +427,31 @@ def multi_finalize(fn, d):
extended = d.getVar("BBCLASSEXTEND", True) or ""
if extended:
+ # the following is to support bbextends with argument, for e.g. multilib
+ # an example is as follow:
+ # BBCLASSEXTEND = "multilib:lib32"
+ # it will create foo-lib32, inheriting multilib.bbclass and set
+ # CURRENTEXTEND to "lib32"
+ extendedmap = {}
+
+ for ext in extended.split():
+ eext = ext.split(':')
+ if len(eext) > 1:
+ extendedmap[eext[1]] = eext[0]
+ else:
+ extendedmap[ext] = ext
+
pn = d.getVar("PN", True)
def extendfunc(name, d):
- d.setVar("PN", "%s-%s" % (pn, name))
- bb.parse.BBHandler.inherit([name], d)
+ if name != extendedmap[name]:
+ d.setVar("BBEXTENDCURR", extendedmap[name])
+ d.setVar("BBEXTENDVARIANT", name)
+ else:
+ d.setVar("PN", "%s-%s" % (pn, name))
+ bb.parse.BBHandler.inherit([extendedmap[name]], d)
safe_d.setVar("BBCLASSEXTEND", extended)
- _create_variants(datastores, extended.split(), extendfunc)
+ _create_variants(datastores, extendedmap.keys(), extendfunc)
for variant, variant_d in datastores.iteritems():
if variant: