mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +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:
parent
781f9b068d
commit
a752f55956
@ -1786,13 +1786,23 @@ class KernelConfig(object):
|
|||||||
config = {}
|
config = {}
|
||||||
for line in text.split('\n'):
|
for line in text.split('\n'):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|
||||||
|
# skip empty lines
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
|
||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
match = cls.not_set_regex.search(line)
|
match = cls.not_set_regex.search(line)
|
||||||
if match:
|
if match:
|
||||||
config[match.group(1)] = 'n'
|
value = 'n'
|
||||||
elif '=' in line:
|
name = match.group(1)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
name, value = line.split('=', 1)
|
name, value = line.split('=', 1)
|
||||||
config[name.strip()] = value.strip()
|
|
||||||
|
name = cls.get_config_name(name.strip())
|
||||||
|
config[name] = value.strip()
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def get(self, name, strict=False):
|
def get(self, name, strict=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user