mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 18:32:15 +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:
@@ -42,12 +42,22 @@ def supports(fn, d):
|
||||
"""Return True if fn has a supported extension"""
|
||||
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):
|
||||
__inherit_cache = d.getVar('__inherit_cache', False) or []
|
||||
#if "${" in files and not deferred:
|
||||
# bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno))
|
||||
files = d.expand(files).split()
|
||||
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)
|
||||
origfile = file
|
||||
for t in ["classes-" + classtype, "classes"]:
|
||||
|
||||
Reference in New Issue
Block a user