summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-08-30 20:47:02 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-30 21:38:11 +0100
commit38d0b3744b5829333148ac4fc97dc45a8d0ba3a5 (patch)
treefd462f3d3df08387506f38cadbe4e723a6fa04f6 /scripts/lib
parent49ef04d3c9eeb76cbbc89b27b4dd1570b7a2552b (diff)
downloadopenembedded-core-38d0b3744b5829333148ac4fc97dc45a8d0ba3a5.tar.gz
openembedded-core-38d0b3744b5829333148ac4fc97dc45a8d0ba3a5.tar.bz2
openembedded-core-38d0b3744b5829333148ac4fc97dc45a8d0ba3a5.zip
wic: add default_image attribute to BitbakeVars
New attribute is used when bitbake variable is requested without specifying image name. The attribute should be set from outside, for example when wic is called with '-e <image>' option. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/wic/utils/oe/misc.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py
index 41e435fc27..040176d486 100644
--- a/scripts/lib/wic/utils/oe/misc.py
+++ b/scripts/lib/wic/utils/oe/misc.py
@@ -131,6 +131,9 @@ class BitbakeVars(defaultdict):
def __init__(self):
defaultdict.__init__(self, dict)
+ # default_image attribute should be set from outside
+ self.default_image = None
+
def _parse_line(self, line, image):
"""
Parse one line from bitbake -e output.
@@ -152,6 +155,9 @@ class BitbakeVars(defaultdict):
Get bitbake variable value lazy way, i.e. run
'bitbake -e' only when variable is requested.
"""
+ if not image:
+ image = self.default_image
+
if image not in self:
# Get bitbake -e output
cmd = "bitbake -e"