diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-02-03 19:16:55 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-04 12:57:35 +0000 |
commit | 3cb93017e64b409e887e37f255ae49bb4e274465 (patch) | |
tree | 61258e6b8d6f99c2ffc19e444ad516a00d6e00bc /scripts/lib/mic/utils | |
parent | 534d9ba70a44ad601a242ed09093d21cd3f032f1 (diff) | |
download | ast2050-yocto-poky-3cb93017e64b409e887e37f255ae49bb4e274465.zip ast2050-yocto-poky-3cb93017e64b409e887e37f255ae49bb4e274465.tar.gz |
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.
(From OE-Core rev: f0bb47b0d7ab6520c105ce131844269172de3efd)
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic/utils')
-rw-r--r-- | scripts/lib/mic/utils/oe/misc.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/lib/mic/utils/oe/misc.py b/scripts/lib/mic/utils/oe/misc.py index 097d44c..77dfe03 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 |