Skip to contentSkip to conversation

cache/ast: Move __VARIANTS handling to parse cache function

PATCH In review Richard Purdie 2 participants 2 messages Aug 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cache/ast: Move __VARIANTS handling to parse cache function

Simple refactoring to allow for multiconfig support.

bitbake/lib/bb/cache.py +5 -1
index c09f929..658f30f 100644
@@ -401,14 +401,18 @@ class Cache(object):
         infos = []
         datastores = cls.load_bbfile(filename, appends, configdata)
         depends = []
+        variants = []
+        # Process the "real" fn last so we can store variants list
         for variant, data in sorted(datastores.items(),
                                     key=lambda i: i[0],
                                     reverse=True):
             virtualfn = cls.realfn2virtual(filename, variant)
+            variants.append(variant)
             depends = depends + (data.getVar("__depends", False) or [])
             if depends and not variant:
                 data.setVar("__depends", depends)
-
+            if virtualfn == filename:
+                data.setVar("__VARIANTS", " ".join(variants))
             info_array = []
             for cache_class in caches_array:
                 info = cache_class(filename, data)
bitbake/lib/bb/parse/ast.py +0 -4
index b407b09..d7185b1 100644
@@ -502,9 +502,5 @@ def multi_finalize(fn, d):
             except bb.parse.SkipRecipe as e:
                 datastores[variant].setVar("__SKIPPED", e.args[0])
 
-    if len(datastores) > 1:
-        variants = filter(None, datastores.keys())
-        safe_d.setVar("__VARIANTS", " ".join(variants))
-
     datastores[""] = d
     return datastores
#1 lore raw
Quoted 4 lines · Richard Purdie

Simple refactoring to allow for multiconfig support.

Looks good.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics