kernel-config: Sync fixes from BLFS

This commit is contained in:
Poltern 2023-12-07 18:49:51 +07:00
parent 774a765d63
commit 34df1ab7fb
2 changed files with 12 additions and 2 deletions

View File

@ -19,5 +19,8 @@ s-kernel-version:
fi
touch s-kernel-version
%.xml: %.toml kernel-config.py kernel_version.py kernel.version
%.xml.tmp: %.toml kernel-config.py kernel_version.py kernel.version
./kernel-config.py $(KERNEL_TREE) $< > $@
%.xml: %.xml.tmp
mv $< $@

View File

@ -185,6 +185,10 @@ def load_kconfig(file):
if_stack += [top]
elif line.startswith('endif'):
if_stack = if_stack[:-1]
if config_buf:
r += [parse_config(config_buf)]
return r
known_config = {}
@ -247,6 +251,7 @@ sep = known_config.get('separate_toplevel_menu')
for i0, val, i1, title, arrow, key, menu, comment in r:
rem = max_line
is_choice = (val == '(X)')
if val:
val += (max_val_len[menu] - len(val)) * ' '
@ -259,7 +264,9 @@ for i0, val, i1, title, arrow, key, menu, comment in r:
if len(title) > rem:
title = title[:rem - 3] + '...'
b = title.lstrip('YyMmNnHh')
b = title
if not is_choice:
b = b.lstrip('YyMmNnHh.' + "".join(map(str, range(10))))
a = title[:len(title) - len(b)]
b0 = "<emphasis role='blue'>" + escape(b[0]) + "</emphasis>"
line += escape(a) + b0 + escape(b[1:]) + escape(arrow)