From f0bb47b0d7ab6520c105ce131844269172de3efd Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 3 Feb 2014 19:16:55 -0600 Subject: wic: Create and use new functions for getting bitbake variables Add get_bitbake_var() and bitbake_env_lines() functions for use by plugins, which will need access to them for customization. Signed-off-by: Tom Zanussi Signed-off-by: Richard Purdie --- scripts/lib/mic/utils/oe/misc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scripts/lib/mic') diff --git a/scripts/lib/mic/utils/oe/misc.py b/scripts/lib/mic/utils/oe/misc.py index 097d44c057..77dfe03630 100644 --- a/scripts/lib/mic/utils/oe/misc.py +++ b/scripts/lib/mic/utils/oe/misc.py @@ -109,6 +109,15 @@ def add_wks_var(key, val): BOOTDD_EXTRA_SPACE = 16384 +__bitbake_env_lines = "" + +def set_bitbake_env_lines(bitbake_env_lines): + global __bitbake_env_lines + __bitbake_env_lines = bitbake_env_lines + +def get_bitbake_env_lines(): + return __bitbake_env_lines + def get_line_val(line, key): """ Extract the value from the VAR="val" string @@ -118,3 +127,10 @@ def get_line_val(line, key): stripped_line = stripped_line.replace('\"', '') return stripped_line return None + +def get_bitbake_var(key): + for line in __bitbake_env_lines.split('\n'): + if (get_line_val(line, key)): + val = get_line_val(line, key) + return val + return None -- cgit 1.2.3-korg