tcmode-external-oe-sdk: handle non-exported vars when parsing setup scripts

JIRA: SB-15362

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
Christopher Larson
2020-08-07 01:05:29 +05:00
parent 7f0040db11
commit 734311e012

View File

@@ -157,7 +157,13 @@ def parse_setup_script(setup):
for line in value.splitlines():
if line.split():
split = shlex.split(line)
if split and split[0] == 'export':
k, v = split[1].split('=', 1)
values[k] = v
if len(split) == 2 and split[0] == 'export':
split = split[1:]
if len(split) == 1:
try:
k, v = split[0].split('=', 1)
except ValueError:
continue
else:
values[k] = v
return values