summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Henrique Ferreira de Freitas <joaohf@gmail.com>2014-04-04 23:14:10 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-05-13 19:35:06 +0100
commitb8e51f73bc8e67ca60b7dd8d67091257aad62efd (patch)
treea2b1d12ae731e4a6566e634ab294b2fcaae5244c
parentd881ec6136255fd0f4a8cf36f9ce148ade02c103 (diff)
downloadopenembedded-core-b8e51f73bc8e67ca60b7dd8d67091257aad62efd.tar.gz
openembedded-core-b8e51f73bc8e67ca60b7dd8d67091257aad62efd.tar.bz2
openembedded-core-b8e51f73bc8e67ca60b7dd8d67091257aad62efd.zip
wic: add find_artifact() to get a specific bitbake variable
This helper is used by source plugins to get specific bitbake variable. Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/mic/utils/oe/misc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/mic/utils/oe/misc.py b/scripts/lib/mic/utils/oe/misc.py
index 5436a0a1fe..16c250aa9f 100644
--- a/scripts/lib/mic/utils/oe/misc.py
+++ b/scripts/lib/mic/utils/oe/misc.py
@@ -142,6 +142,20 @@ def find_bitbake_env_lines(image_name):
return bitbake_env_lines
+def find_artifact(bitbake_env_lines, variable):
+ """
+ Gather the build artifact for the current image (the image_name
+ e.g. core-image-minimal) for the current MACHINE set in local.conf
+ """
+ retval = ""
+
+ for line in bitbake_env_lines.split('\n'):
+ if (get_line_val(line, variable)):
+ retval = get_line_val(line, variable)
+ break
+
+ return retval
+
def get_line_val(line, key):
"""
Extract the value from the VAR="val" string