diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-06 17:44:32 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-16 22:23:18 +0100 |
| commit | 32e44e286692b0aac10a3887a0231e8cd772f082 (patch) | |
| tree | 70d79914d413ac201232ef2779ba59adedd2a309 /bitbake/lib/bb/parse/parse_py | |
| parent | e20af03c0210a0a0af1a5daad7cf859ea3e70cc5 (diff) | |
| download | poky-32e44e286692b0aac10a3887a0231e8cd772f082.tar.gz | |
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>
Diffstat (limited to 'bitbake/lib/bb/parse/parse_py')
| -rw-r--r-- | bitbake/lib/bb/parse/parse_py/BBHandler.py | 10 |
1 files changed, 10 insertions, 0 deletions
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): | |||
| 42 | """Return True if fn has a supported extension""" | 42 | """Return True if fn has a supported extension""" |
| 43 | return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] | 43 | return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"] |
| 44 | 44 | ||
| 45 | def inherit_defer(expression, fn, lineno, d): | ||
| 46 | inherit = (expression, fn, lineno) | ||
| 47 | inherits = d.getVar('__BBDEFINHERITS', False) or [] | ||
| 48 | inherits.append(inherit) | ||
| 49 | d.setVar('__BBDEFINHERITS', inherits) | ||
| 50 | |||
| 45 | def inherit(files, fn, lineno, d, deferred=False): | 51 | def inherit(files, fn, lineno, d, deferred=False): |
| 46 | __inherit_cache = d.getVar('__inherit_cache', False) or [] | 52 | __inherit_cache = d.getVar('__inherit_cache', False) or [] |
| 47 | #if "${" in files and not deferred: | 53 | #if "${" in files and not deferred: |
| 48 | # bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno)) | 54 | # bb.warn("%s:%s has non deferred conditional inherit" % (fn, lineno)) |
| 49 | files = d.expand(files).split() | 55 | files = d.expand(files).split() |
| 50 | for file in files: | 56 | for file in files: |
| 57 | defer = (d.getVar("BB_DEFER_BBCLASSES") or "").split() | ||
| 58 | if not deferred and file in defer: | ||
| 59 | inherit_defer(file, fn, lineno, d) | ||
| 60 | continue | ||
| 51 | classtype = d.getVar("__bbclasstype", False) | 61 | classtype = d.getVar("__bbclasstype", False) |
| 52 | origfile = file | 62 | origfile = file |
| 53 | for t in ["classes-" + classtype, "classes"]: | 63 | for t in ["classes-" + classtype, "classes"]: |
