From 32e44e286692b0aac10a3887a0231e8cd772f082 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 6 Jun 2025 17:44:32 +0100 Subject: 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 --- bitbake/lib/bb/parse/parse_py/BBHandler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bitbake/lib/bb/parse/parse_py') diff --git a/bitbake/lib/bb/parse/parse_py/BBHandler.py b/bitbake/lib/bb/parse/parse_py/BBHandler.py index 4bdb11994f..008fec2308 100644 --- a/bitbake/lib/bb/parse/parse_py/BBHandler.py +++ b/bitbake/lib/bb/parse/parse_py/BBHandler.py @@ -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"]: -- cgit v1.2.3-54-g00ecf