diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-09 13:55:01 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-25 13:16:24 +0100 |
commit | 695998f921b691f196825e9067b6db399d691e53 (patch) | |
tree | 29e013e9b3c5046d80974618a3c1e0d841fa1d27 /bitbake/lib/bb/cache.py | |
parent | 3673a43c22f8adb98945501786077a77a798fb93 (diff) | |
download | poky-695998f921b691f196825e9067b6db399d691e53.tar.gz |
bitbake: cooker: Add FILE_LAYERNAME variable containing the layername for a recipe
There are times when it would be useful for code to know which layer
(or collection in old bitbake terms) it is contained within.
Add support for FILE_LAYERNAME to be set by bitbake when parsing a recipe
so that it is possible to determine this. To do it, we need to pass data
from the cooker into the recipe endpoints, since only the top level cooker
information knows about the layer structure which makes the patch a bit
painful.
The idea is that this would make layer overrides possible:
OVERRIDES .= ":layer-${FILE_LAYERNAME}"
which then opens possibilities like:
WARN_QA:append:layer-core = " patch-fuzz"
as an example where OE-Core could enable specific QA tests only for that
specific layer.
(Bitbake rev: 7090a14b0035842112d073acf7f2ed1a01fdeccf)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cache.py')
-rw-r--r-- | bitbake/lib/bb/cache.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 10910a6809..5ea41c5de0 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -514,11 +514,11 @@ class Cache(object): | |||
514 | 514 | ||
515 | return len(self.depends_cache) | 515 | return len(self.depends_cache) |
516 | 516 | ||
517 | def parse(self, filename, appends): | 517 | def parse(self, filename, appends, layername): |
518 | """Parse the specified filename, returning the recipe information""" | 518 | """Parse the specified filename, returning the recipe information""" |
519 | self.logger.debug("Parsing %s", filename) | 519 | self.logger.debug("Parsing %s", filename) |
520 | infos = [] | 520 | infos = [] |
521 | datastores = self.databuilder.parseRecipeVariants(filename, appends, mc=self.mc) | 521 | datastores = self.databuilder.parseRecipeVariants(filename, appends, mc=self.mc, layername=layername) |
522 | depends = [] | 522 | depends = [] |
523 | variants = [] | 523 | variants = [] |
524 | # Process the "real" fn last so we can store variants list | 524 | # Process the "real" fn last so we can store variants list |