summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse
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:43 +0100
commita2b9ef9d78665393a94296f87b860486e854e3d3 (patch)
tree5b08b692b0872e0b8b18d45d913f79f3f5ea5572 /bitbake/lib/bb/parse
parent21c5985812c889a4100114af06152c43cae78c1c (diff)
downloadpoky-a2b9ef9d78665393a94296f87b860486e854e3d3.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. (Bitbake rev: 8d3c899e0a15840c54de26d2f1fc552430517778) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r--bitbake/lib/bb/parse/ast.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index bf70ad2658..e41bb74f40 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -427,13 +427,31 @@ def multi_finalize(fn, d):
427 427
428 extended = d.getVar("BBCLASSEXTEND", True) or "" 428 extended = d.getVar("BBCLASSEXTEND", True) or ""
429 if extended: 429 if extended:
430 # the following is to support bbextends with argument, for e.g. multilib
431 # an example is as follow:
432 # BBCLASSEXTEND = "multilib:lib32"
433 # it will create foo-lib32, inheriting multilib.bbclass and set
434 # CURRENTEXTEND to "lib32"
435 extendedmap = {}
436
437 for ext in extended.split():
438 eext = ext.split(':')
439 if len(eext) > 1:
440 extendedmap[eext[1]] = eext[0]
441 else:
442 extendedmap[ext] = ext
443
430 pn = d.getVar("PN", True) 444 pn = d.getVar("PN", True)
431 def extendfunc(name, d): 445 def extendfunc(name, d):
432 d.setVar("PN", "%s-%s" % (pn, name)) 446 if name != extendedmap[name]:
433 bb.parse.BBHandler.inherit([name], d) 447 d.setVar("BBEXTENDCURR", extendedmap[name])
448 d.setVar("BBEXTENDVARIANT", name)
449 else:
450 d.setVar("PN", "%s-%s" % (pn, name))
451 bb.parse.BBHandler.inherit([extendedmap[name]], d)
434 452
435 safe_d.setVar("BBCLASSEXTEND", extended) 453 safe_d.setVar("BBCLASSEXTEND", extended)
436 _create_variants(datastores, extended.split(), extendfunc) 454 _create_variants(datastores, extendedmap.keys(), extendfunc)
437 455
438 for variant, variant_d in datastores.iteritems(): 456 for variant, variant_d in datastores.iteritems():
439 if variant: 457 if variant: