1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target: Fix KernelConfig parsing

Use the canonical option name in the underlying mapping, so looking up
the canonicalized option name will work as expected.

Otherwise, looking up the key CONFIG_FONT_8x8 would not work, since the
internal representation uses 'CONFIG_FONT_8x8' and the user input is
turned into 'CONFIG_FONT_8X8' (note the capital "X").
This commit is contained in:
Douglas RAILLARD 2018-12-17 14:57:29 +00:00 committed by Marc Bonnici
parent 781f9b068d
commit a752f55956

View File

@ -1786,13 +1786,23 @@ class KernelConfig(object):
config = {}
for line in text.split('\n'):
line = line.strip()
# skip empty lines
if not line:
continue
if line.startswith('#'):
match = cls.not_set_regex.search(line)
if match:
config[match.group(1)] = 'n'
elif '=' in line:
value = 'n'
name = match.group(1)
else:
continue
else:
name, value = line.split('=', 1)
config[name.strip()] = value.strip()
name = cls.get_config_name(name.strip())
config[name] = value.strip()
return config
def get(self, name, strict=False):