diff options
-rw-r--r-- | scripts/lib/wic/utils/oe/misc.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/lib/wic/utils/oe/misc.py b/scripts/lib/wic/utils/oe/misc.py index fe188c9d26..2a2fcc94fb 100644 --- a/scripts/lib/wic/utils/oe/misc.py +++ b/scripts/lib/wic/utils/oe/misc.py | |||
@@ -27,6 +27,7 @@ | |||
27 | """Miscellaneous functions.""" | 27 | """Miscellaneous functions.""" |
28 | 28 | ||
29 | import os | 29 | import os |
30 | import re | ||
30 | from collections import defaultdict | 31 | from collections import defaultdict |
31 | from distutils import spawn | 32 | from distutils import spawn |
32 | 33 | ||
@@ -148,21 +149,18 @@ class BitbakeVars(defaultdict): | |||
148 | self.default_image = None | 149 | self.default_image = None |
149 | self.vars_dir = None | 150 | self.vars_dir = None |
150 | 151 | ||
151 | def _parse_line(self, line, image): | 152 | def _parse_line(self, line, image, matcher=re.compile(r"^(\w+)=(.+)")): |
152 | """ | 153 | """ |
153 | Parse one line from bitbake -e output or from .env file. | 154 | Parse one line from bitbake -e output or from .env file. |
154 | Put result key-value pair into the storage. | 155 | Put result key-value pair into the storage. |
155 | """ | 156 | """ |
156 | if "=" not in line: | 157 | if "=" not in line: |
157 | return | 158 | return |
158 | try: | 159 | match = matcher.match(line) |
159 | key, val = line.split("=") | 160 | if not match: |
160 | except ValueError: | ||
161 | return | 161 | return |
162 | key = key.strip() | 162 | key, val = match.groups() |
163 | val = val.strip() | 163 | self[image][key] = val.strip('"') |
164 | if key.replace('_', '').isalnum(): | ||
165 | self[image][key] = val.strip('"') | ||
166 | 164 | ||
167 | def get_var(self, var, image=None): | 165 | def get_var(self, var, image=None): |
168 | """ | 166 | """ |