]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Set default set of bitbake variables
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 10 Jul 2015 11:08:26 +0000 (14:08 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Jul 2015 12:34:50 +0000 (13:34 +0100)
Set default set of bitbake variables to the set of variables
for the first parsed image.

This allows wic to find proper bitbake varibale values
if it's called with '-e <image>' even without specifying
image in the call of get_bitbake_var.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/utils/oe/misc.py

index 2f9f515cf8ab6a63f0ea429a3a3091581694eccf..49787456b2ae2f7f715702866cbc02b6a5017ca0 100644 (file)
@@ -146,6 +146,11 @@ def get_bitbake_var(var, image=None):
             if key.replace('_', '').isalnum():
                 _BITBAKE_VARS[image][key] = val.strip('"')
 
+        # Make first image a default set of variables
+        images = [key for key in _BITBAKE_VARS if key]
+        if len(images) == 1:
+            _BITBAKE_VARS[None] = _BITBAKE_VARS[image]
+
     return _BITBAKE_VARS[image].get(var)
 
 def parse_sourceparams(sourceparams):