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 | |
parent | 534d9ba70a44ad601a242ed09093d21cd3f032f1 (diff) | |
download | 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')
-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 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): | |||
109 | 109 | ||
110 | BOOTDD_EXTRA_SPACE = 16384 | 110 | BOOTDD_EXTRA_SPACE = 16384 |
111 | 111 | ||
112 | __bitbake_env_lines = "" | ||
113 | |||
114 | def set_bitbake_env_lines(bitbake_env_lines): | ||
115 | global __bitbake_env_lines | ||
116 | __bitbake_env_lines = bitbake_env_lines | ||
117 | |||
118 | def get_bitbake_env_lines(): | ||
119 | return __bitbake_env_lines | ||
120 | |||
112 | def get_line_val(line, key): | 121 | def get_line_val(line, key): |
113 | """ | 122 | """ |
114 | Extract the value from the VAR="val" string | 123 | Extract the value from the VAR="val" string |
@@ -118,3 +127,10 @@ def get_line_val(line, key): | |||
118 | stripped_line = stripped_line.replace('\"', '') | 127 | stripped_line = stripped_line.replace('\"', '') |
119 | return stripped_line | 128 | return stripped_line |
120 | return None | 129 | return None |
130 | |||
131 | def get_bitbake_var(key): | ||
132 | for line in __bitbake_env_lines.split('\n'): | ||
133 | if (get_line_val(line, key)): | ||
134 | val = get_line_val(line, key) | ||
135 | return val | ||
136 | return None | ||