mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
bitbake: ast/BBHandler: Add support for BB_DEFER_BBCLASSES
Add support for automatically promoting class inherits to deferred inherits by listing them in the BB_DEFER_BBCLASSES variable. (Bitbake rev: 8e741b2e885a12d119788d04aa4efcd724dd6bfa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
e20af03c02
commit
32e44e2866
|
@ -340,9 +340,7 @@ class InheritDeferredNode(AstNode):
|
||||||
self.inherit = (classes, filename, lineno)
|
self.inherit = (classes, filename, lineno)
|
||||||
|
|
||||||
def eval(self, data):
|
def eval(self, data):
|
||||||
inherits = data.getVar('__BBDEFINHERITS', False) or []
|
bb.parse.BBHandler.inherit_defer(*self.inherit, data)
|
||||||
inherits.append(self.inherit)
|
|
||||||
data.setVar('__BBDEFINHERITS', inherits)
|
|
||||||
|
|
||||||
class AddFragmentsNode(AstNode):
|
class AddFragmentsNode(AstNode):
|
||||||
def __init__(self, filename, lineno, fragments_path_prefix, fragments_variable, flagged_variables_list_variable):
|
def __init__(self, filename, lineno, fragments_path_prefix, fragments_variable, flagged_variables_list_variable):
|
||||||
|
@ -571,9 +569,7 @@ def multi_finalize(fn, d):
|
||||||
d.setVar("BBEXTENDVARIANT", variantmap[name])
|
d.setVar("BBEXTENDVARIANT", variantmap[name])
|
||||||
else:
|
else:
|
||||||
d.setVar("PN", "%s-%s" % (pn, name))
|
d.setVar("PN", "%s-%s" % (pn, name))
|
||||||
inherits = d.getVar('__BBDEFINHERITS', False) or []
|
bb.parse.BBHandler.inherit_defer(extendedmap[name], fn, 0, d)
|
||||||
inherits.append((extendedmap[name], fn, 0))
|
|
||||||
d.setVar('__BBDEFINHERITS', inherits)
|
|
||||||
|
|
||||||
safe_d.setVar("BBCLASSEXTEND", extended)
|
safe_d.setVar("BBCLASSEXTEND", extended)
|
||||||
_create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise)
|
_create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise)
|
||||||
|
|
|
@ -42,12 +42,22 @@ def supports(fn, d):
|
||||||
"""Return True if fn has a supported extension"""
|
"""Return True if fn has a supported extension"""
|
||||||
return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"]
|
return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"]
|
||||||
|
|
||||||
|
def inherit_defer(expression, fn, lineno, d):
|
||||||
|
inherit = (expression, fn, lineno)
|
||||||
|
inherits = d.getVar('__BBDEFINHERITS', False) or []
|
||||||
|
inherits.append(inherit)
|
||||||
|
d.setVar('__BBDEFINHERITS', inherits)
|
||||||
|
|
||||||
def inherit(files, fn, lineno, d, deferred=False):
|
def inherit(files, fn, lineno, d, deferred=False):
|
||||||
__inherit_cache = d.getVar('__inherit_cache', False) or []
|
__inherit_cache = d.getVar('__inherit_cache', False) or []
|
||||||
#if "${" in files and not deferred:
|
#if "${" in files and not deferred:
|
||||||
# bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
|
# bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
|
||||||
files = d.expand(files).split()
|
files = d.expand(files).split()
|
||||||
for file in files:
|
for file in files:
|
||||||
|
defer = (d.getVar("BB_DEFER_BBCLASSES") or "").split()
|
||||||
|
if not deferred and file in defer:
|
||||||
|
inherit_defer(file, fn, lineno, d)
|
||||||
|
continue
|
||||||
classtype = d.getVar("__bbclasstype", False)
|
classtype = d.getVar("__bbclasstype", False)
|
||||||
origfile = file
|
origfile = file
|
||||||
for t in ["classes-" + classtype, "classes"]:
|
for t in ["classes-" + classtype, "classes"]:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user