[oe-commits] [bitbake] 05/10: cache/ast: Move __VARIANTS handling to parse cache function

git at git.openembedded.org git at git.openembedded.org
Tue Aug 16 15:13:37 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 7d4cc8b84901900633286f0827047d1397436bbd
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Aug 15 17:59:56 2016 +0100

    cache/ast: Move __VARIANTS handling to parse cache function
    
    Simple refactoring to allow for multiconfig support.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/cache.py     | 6 +++++-
 lib/bb/parse/ast.py | 4 ----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index c09f929..658f30f 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -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)
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 8b9baa7..0fc3a9e 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -469,9 +469,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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list