kconfiglib: Update to the 12.14.0 release

A large number of changes have happened upstream since our last sync
which was to 375506d.  The reason to do the upgrade at this point is for
improved Python 3 support.

As part of this upgrade we need to update moveconfig.py and
genboardscfg.py the current API.  This is:
- Change "kconfiglib.Config" calls to "kconfiglib.Kconfig"
- Change get_symbol() calls to syms.get().
- Change get_value() to str_value.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Tom Rini 2019-09-20 17:42:09 -04:00
parent 5e7c8a39e6
commit 65e05ddc1a
3 changed files with 6501 additions and 3015 deletions

File diff suppressed because it is too large Load Diff

View File

@ -118,12 +118,12 @@ class KconfigScanner:
} }
def __init__(self): def __init__(self):
"""Scan all the Kconfig files and create a Config object.""" """Scan all the Kconfig files and create a Kconfig object."""
# Define environment variables referenced from Kconfig # Define environment variables referenced from Kconfig
os.environ['srctree'] = os.getcwd() os.environ['srctree'] = os.getcwd()
os.environ['UBOOTVERSION'] = 'dummy' os.environ['UBOOTVERSION'] = 'dummy'
os.environ['KCONFIG_OBJDIR'] = '' os.environ['KCONFIG_OBJDIR'] = ''
self._conf = kconfiglib.Config(print_warnings=False) self._conf = kconfiglib.Kconfig(warn=False)
def __del__(self): def __del__(self):
"""Delete a leftover temporary file before exit. """Delete a leftover temporary file before exit.
@ -174,7 +174,7 @@ class KconfigScanner:
# Get the value of CONFIG_SYS_ARCH, CONFIG_SYS_CPU, ... etc. # Get the value of CONFIG_SYS_ARCH, CONFIG_SYS_CPU, ... etc.
# Set '-' if the value is empty. # Set '-' if the value is empty.
for key, symbol in list(self._SYMBOL_TABLE.items()): for key, symbol in list(self._SYMBOL_TABLE.items()):
value = self._conf.get_symbol(symbol).get_value() value = self._conf.syms.get(symbol).str_value
if value: if value:
params[key] = value params[key] = value
else: else:

View File

@ -851,7 +851,7 @@ class KconfigScanner:
os.environ['srctree'] = os.getcwd() os.environ['srctree'] = os.getcwd()
os.environ['UBOOTVERSION'] = 'dummy' os.environ['UBOOTVERSION'] = 'dummy'
os.environ['KCONFIG_OBJDIR'] = '' os.environ['KCONFIG_OBJDIR'] = ''
self.conf = kconfiglib.Config() self.conf = kconfiglib.Kconfig()
class KconfigParser: class KconfigParser:
@ -1525,7 +1525,7 @@ def find_kconfig_rules(kconf, config, imply_config):
"""Check whether a config has a 'select' or 'imply' keyword """Check whether a config has a 'select' or 'imply' keyword
Args: Args:
kconf: Kconfig.Config object kconf: Kconfiglib.Kconfig object
config: Name of config to check (without CONFIG_ prefix) config: Name of config to check (without CONFIG_ prefix)
imply_config: Implying config (without CONFIG_ prefix) which may or imply_config: Implying config (without CONFIG_ prefix) which may or
may not have an 'imply' for 'config') may not have an 'imply' for 'config')
@ -1533,7 +1533,7 @@ def find_kconfig_rules(kconf, config, imply_config):
Returns: Returns:
Symbol object for 'config' if found, else None Symbol object for 'config' if found, else None
""" """
sym = kconf.get_symbol(imply_config) sym = kconf.syms.get(imply_config)
if sym: if sym:
for sel in sym.get_selected_symbols() | sym.get_implied_symbols(): for sel in sym.get_selected_symbols() | sym.get_implied_symbols():
if sel.get_name() == config: if sel.get_name() == config:
@ -1547,7 +1547,7 @@ def check_imply_rule(kconf, config, imply_config):
to add an 'imply' for 'config' to that part of the Kconfig. to add an 'imply' for 'config' to that part of the Kconfig.
Args: Args:
kconf: Kconfig.Config object kconf: Kconfiglib.Kconfig object
config: Name of config to check (without CONFIG_ prefix) config: Name of config to check (without CONFIG_ prefix)
imply_config: Implying config (without CONFIG_ prefix) which may or imply_config: Implying config (without CONFIG_ prefix) which may or
may not have an 'imply' for 'config') may not have an 'imply' for 'config')
@ -1558,7 +1558,7 @@ def check_imply_rule(kconf, config, imply_config):
line number within the Kconfig file, or 0 if none line number within the Kconfig file, or 0 if none
message indicating the result message indicating the result
""" """
sym = kconf.get_symbol(imply_config) sym = kconf.syms.get(imply_config)
if not sym: if not sym:
return 'cannot find sym' return 'cannot find sym'
locs = sym.get_def_locations() locs = sym.get_def_locations()
@ -1784,7 +1784,7 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added,
if skip_added: if skip_added:
show = False show = False
else: else:
sym = kconf.get_symbol(iconfig[CONFIG_LEN:]) sym = kconf.syms.get(iconfig[CONFIG_LEN:])
fname = '' fname = ''
if sym: if sym:
locs = sym.get_def_locations() locs = sym.get_def_locations()