* [PATCH 1/2] cookerdata: Be consistent with what type bb_data represents
@ 2023-11-21 2:09 Peter Kjellerstedt
2023-11-21 2:09 ` [PATCH 2/2] cache: Simplify virtualfn2realfn() Peter Kjellerstedt
0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2023-11-21 2:09 UTC (permalink / raw)
To: bitbake-devel
In _parse_recipe(), bb_data was initially a datastore object, but then
after the call to bb.parse.handle() it was all of a sudden turned into a
dict of variant:datastore pairs. At the same time, parseRecipeVariants()
used bb_data for datastore objects, while parseRecipe() used it for the
dicts of variant:datastore pairs.
Change these functions to consistently use "bb_data" for datastore
objects and use "datastores" for the dicts of variant:datastore pairs.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
bitbake/lib/bb/cookerdata.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 42b8d64685..0649e40995 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -503,8 +503,8 @@ class CookerDataBuilder(object):
if appends:
bb_data.setVar('__BBAPPEND', " ".join(appends))
- bb_data = bb.parse.handle(bbfile, bb_data)
- return bb_data
+
+ return bb.parse.handle(bbfile, bb_data)
def parseRecipeVariants(self, bbfile, appends, virtonly=False, mc=None, layername=None):
"""
@@ -516,8 +516,7 @@ class CookerDataBuilder(object):
(bbfile, virtual, mc) = bb.cache.virtualfn2realfn(bbfile)
bb_data = self.mcdata[mc].createCopy()
bb_data.setVar("__ONLYFINALISE", virtual or "default")
- datastores = self._parse_recipe(bb_data, bbfile, appends, mc, layername)
- return datastores
+ return self._parse_recipe(bb_data, bbfile, appends, mc, layername)
if mc is not None:
bb_data = self.mcdata[mc].createCopy()
@@ -543,5 +542,5 @@ class CookerDataBuilder(object):
"""
logger.debug("Parsing %s (full)" % virtualfn)
(fn, virtual, mc) = bb.cache.virtualfn2realfn(virtualfn)
- bb_data = self.parseRecipeVariants(virtualfn, appends, virtonly=True, layername=layername)
- return bb_data[virtual]
+ datastores = self.parseRecipeVariants(virtualfn, appends, virtonly=True, layername=layername)
+ return datastores[virtual]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] cache: Simplify virtualfn2realfn()
2023-11-21 2:09 [PATCH 1/2] cookerdata: Be consistent with what type bb_data represents Peter Kjellerstedt
@ 2023-11-21 2:09 ` Peter Kjellerstedt
0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2023-11-21 2:09 UTC (permalink / raw)
To: bitbake-devel
Also correct the description of variant2virtual().
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
bitbake/lib/bb/cache.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index 5ea41c5de0..18d5574a31 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -344,9 +344,7 @@ def virtualfn2realfn(virtualfn):
"""
mc = ""
if virtualfn.startswith('mc:') and virtualfn.count(':') >= 2:
- elems = virtualfn.split(':')
- mc = elems[1]
- virtualfn = ":".join(elems[2:])
+ (_, mc, virtualfn) = virtualfn.split(':', 2)
fn = virtualfn
cls = ""
@@ -369,7 +367,7 @@ def realfn2virtual(realfn, cls, mc):
def variant2virtual(realfn, variant):
"""
- Convert a real filename + the associated subclass keyword to a virtual filename
+ Convert a real filename + a variant to a virtual filename
"""
if variant == "":
return realfn
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-21 2:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21 2:09 [PATCH 1/2] cookerdata: Be consistent with what type bb_data represents Peter Kjellerstedt
2023-11-21 2:09 ` [PATCH 2/2] cache: Simplify virtualfn2realfn() Peter Kjellerstedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.