diff options
Diffstat (limited to 'bitbake/lib/bb/parse/ast.py')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index 290ed45048..ea1096f2de 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -340,9 +340,7 @@ class InheritDeferredNode(AstNode): | |||
340 | self.inherit = (classes, filename, lineno) | 340 | self.inherit = (classes, filename, lineno) |
341 | 341 | ||
342 | def eval(self, data): | 342 | def eval(self, data): |
343 | inherits = data.getVar('__BBDEFINHERITS', False) or [] | 343 | bb.parse.BBHandler.inherit_defer(*self.inherit, data) |
344 | inherits.append(self.inherit) | ||
345 | data.setVar('__BBDEFINHERITS', inherits) | ||
346 | 344 | ||
347 | class AddFragmentsNode(AstNode): | 345 | class AddFragmentsNode(AstNode): |
348 | def __init__(self, filename, lineno, fragments_path_prefix, fragments_variable, flagged_variables_list_variable): | 346 | def __init__(self, filename, lineno, fragments_path_prefix, fragments_variable, flagged_variables_list_variable): |
@@ -471,6 +469,17 @@ def finalize(fn, d, variant = None): | |||
471 | if d.getVar("_FAILPARSINGERRORHANDLED", False) == True: | 469 | if d.getVar("_FAILPARSINGERRORHANDLED", False) == True: |
472 | raise bb.BBHandledException() | 470 | raise bb.BBHandledException() |
473 | 471 | ||
472 | inherits = [x[0] for x in (d.getVar('__BBDEFINHERITS', False) or [('',)])] | ||
473 | bb.event.fire(bb.event.RecipePreDeferredInherits(fn, inherits), d) | ||
474 | |||
475 | while True: | ||
476 | inherits = d.getVar('__BBDEFINHERITS', False) or [] | ||
477 | if not inherits: | ||
478 | break | ||
479 | inherit, filename, lineno = inherits.pop(0) | ||
480 | d.setVar('__BBDEFINHERITS', inherits) | ||
481 | bb.parse.BBHandler.inherit(inherit, filename, lineno, d, deferred=True) | ||
482 | |||
474 | for var in d.getVar('__BBHANDLERS', False) or []: | 483 | for var in d.getVar('__BBHANDLERS', False) or []: |
475 | # try to add the handler | 484 | # try to add the handler |
476 | handlerfn = d.getVarFlag(var, "filename", False) | 485 | handlerfn = d.getVarFlag(var, "filename", False) |
@@ -525,14 +534,6 @@ def multi_finalize(fn, d): | |||
525 | logger.debug("Appending .bbappend file %s to %s", append, fn) | 534 | logger.debug("Appending .bbappend file %s to %s", append, fn) |
526 | bb.parse.BBHandler.handle(append, d, True) | 535 | bb.parse.BBHandler.handle(append, d, True) |
527 | 536 | ||
528 | while True: | ||
529 | inherits = d.getVar('__BBDEFINHERITS', False) or [] | ||
530 | if not inherits: | ||
531 | break | ||
532 | inherit, filename, lineno = inherits.pop(0) | ||
533 | d.setVar('__BBDEFINHERITS', inherits) | ||
534 | bb.parse.BBHandler.inherit(inherit, filename, lineno, d, deferred=True) | ||
535 | |||
536 | onlyfinalise = d.getVar("__ONLYFINALISE", False) | 537 | onlyfinalise = d.getVar("__ONLYFINALISE", False) |
537 | 538 | ||
538 | safe_d = d | 539 | safe_d = d |
@@ -568,7 +569,7 @@ def multi_finalize(fn, d): | |||
568 | d.setVar("BBEXTENDVARIANT", variantmap[name]) | 569 | d.setVar("BBEXTENDVARIANT", variantmap[name]) |
569 | else: | 570 | else: |
570 | d.setVar("PN", "%s-%s" % (pn, name)) | 571 | d.setVar("PN", "%s-%s" % (pn, name)) |
571 | bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d) | 572 | bb.parse.BBHandler.inherit_defer(extendedmap[name], fn, 0, d) |
572 | 573 | ||
573 | safe_d.setVar("BBCLASSEXTEND", extended) | 574 | safe_d.setVar("BBCLASSEXTEND", extended) |
574 | _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise) | 575 | _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise) |