mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-22 14:41:42 +00:00
moveconfig: Update to newer kconfiglib
Some of the more advanced features of this tool don't work anymore since kconfiglib was update. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
a8ba35bf23
commit
ea40b20431
1 changed files with 12 additions and 12 deletions
|
@ -1262,8 +1262,8 @@ def find_kconfig_rules(kconf, config, imply_config):
|
||||||
"""
|
"""
|
||||||
sym = kconf.syms.get(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, cond in (sym.selects + sym.implies):
|
||||||
if sel.get_name() == config:
|
if sel == config:
|
||||||
return sym
|
return sym
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -1288,10 +1288,10 @@ def check_imply_rule(kconf, config, imply_config):
|
||||||
sym = kconf.syms.get(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()
|
nodes = sym.nodes
|
||||||
if len(locs) != 1:
|
if len(nodes) != 1:
|
||||||
return '%d locations' % len(locs)
|
return '%d locations' % len(nodes)
|
||||||
fname, linenum = locs[0]
|
fname, linenum = nodes[0].filename, nodes[0].linern
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
if cwd and fname.startswith(cwd):
|
if cwd and fname.startswith(cwd):
|
||||||
fname = fname[len(cwd) + 1:]
|
fname = fname[len(cwd) + 1:]
|
||||||
|
@ -1502,9 +1502,9 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added,
|
||||||
iconfig[CONFIG_LEN:])
|
iconfig[CONFIG_LEN:])
|
||||||
kconfig_info = ''
|
kconfig_info = ''
|
||||||
if sym:
|
if sym:
|
||||||
locs = sym.get_def_locations()
|
nodes = sym.nodes
|
||||||
if len(locs) == 1:
|
if len(nodes) == 1:
|
||||||
fname, linenum = locs[0]
|
fname, linenum = nodes[0].filename, nodes[0].linenr
|
||||||
if cwd and fname.startswith(cwd):
|
if cwd and fname.startswith(cwd):
|
||||||
fname = fname[len(cwd) + 1:]
|
fname = fname[len(cwd) + 1:]
|
||||||
kconfig_info = '%s:%d' % (fname, linenum)
|
kconfig_info = '%s:%d' % (fname, linenum)
|
||||||
|
@ -1514,9 +1514,9 @@ def do_imply_config(config_list, add_imply, imply_flags, skip_added,
|
||||||
sym = kconf.syms.get(iconfig[CONFIG_LEN:])
|
sym = kconf.syms.get(iconfig[CONFIG_LEN:])
|
||||||
fname = ''
|
fname = ''
|
||||||
if sym:
|
if sym:
|
||||||
locs = sym.get_def_locations()
|
nodes = sym.nodes
|
||||||
if len(locs) == 1:
|
if len(nodes) == 1:
|
||||||
fname, linenum = locs[0]
|
fname, linenum = nodes[0].filename, nodes[0].linenr
|
||||||
if cwd and fname.startswith(cwd):
|
if cwd and fname.startswith(cwd):
|
||||||
fname = fname[len(cwd) + 1:]
|
fname = fname[len(cwd) + 1:]
|
||||||
in_arch_board = not sym or (fname.startswith('arch') or
|
in_arch_board = not sym or (fname.startswith('arch') or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue