| Age | Commit message (Collapse) | Author |
|
New features:
- 105c835 ("Add helper for splitting expressions")
- 509e374 ("Add Choice.direct_dep field")
A terminal menuconfig implementation has been added which relies on
these features.
Other improvements:
- c1c5ef2 ("Print a warning for malformed .config lines")
- 09b8c58 ("Give filename and context for UnicodeDecodeError")
|
|
To avoid confusing it with the new terminal menuconfig implementation.
Clean up the README a bit at the same time, removing some stuff that's
less essential now (e.g. the menuconfig_example.py "screenshot").
|
|
|
|
|
|
|
|
|
|
Uses the 'curses' module, which is in the Python standard library. Only
Python 3 is supported, mostly due to Unicode support.
Windows support is provided through an external package which adds
support for the 'curses' module on Windows.
See the changes and the docstring in the newly added menuconfig.py for
more information.
Piggyback a README notes mentioning that Kconfiglib supports Unicode.
|
|
These errors are a pain to debug otherwise, and might look like
Kconfiglib brokenness.
Another option would be ignore decoding errors, or do the
'surrogateescape' thing on reading and writing, but keep it simple for
now. Pointing out the problem might be more helpful.
|
|
Flag lines matching neither 'CONFIG_FOO=...' nor
'# CONFIG_FOO is not set' that aren't blank or comments.
|
|
Same as Symbol.direct_dep (OR of node dependencies from all definition
locations). It's handy to have available when generating information
about choices.
|
|
I've had to implement the logic for walking reverse dependencies (from
select) a couple of times now, and it's always a bit tricky to get
right. Reduce code duplication and simplify things by adding a helper
function split_expr() that splits an expression into a list of either
its AND or OR operands.
A nice side effect is that e.g. the warning generated for selecting a
symbol with unsatisfied direct dependencies now lists the selecting
symbols in the order that they appear in the Kconfig files.
split_expr() might be helpful for splitting other types of expressions
as well, e.g. to put operands on separate lines when generating
documentation.
|
|
New features and improvements:
- 7245bad ("Parenthesize && expressions within || expressions")
makes expressions more readable.
- 2259d35 ("Generalize is_menuconfig to non-symbol items")
can simplify menuconfig implementations.
- c7ac6f8 ("Add parent deps to the right in _T_IF") makes parent
dependencies consistently appear on the right in expressions, with
the outermost parent dependency the furthest to the right.
New warnings:
- 7ba79ca ("Warn if user (.config) value is outside of 'range'")
- 225ec4b ("Warn if a choice symbol is selected or implied")
Some obscure false positive warnings for named choices were fixed too.
This came up in
https://github.com/zephyrproject-rtos/zephyr/issues/6948.
- e8408a0 ("Move sanity checking to after _finalize_tree()")
|
|
Previously, the warnings
warning: FOO (defined at Kconfig:1, Kconfig:6) defined with type unknown
warning: the default selection BAR (defined at Kconfig:9) of FOO (defined at Kconfig:1, Kconfig:6) is not contained in the choice
were printed for this (obscure, but okay) pair of definitions:
choice FOO
default BAR
endchoice
choice FOO
prompt "foo"
config BAR
bool "bar"
endchoice
The problem is that BAR is not known to be a choice symbol by the time
the first choice definition is encountered in _finalize_tree(), since
that's determined only when the second definition is encountered (it
needs to happen there, because implicit submenus can influence whether a
symbol is a choice symbol or not, and implicit submenus are determined
in _finalize_tree()).
Fix it by moving the sanity checks out of _finalize_tree() and into a
separate pass over all symbols and choices that runs after
_finalize_tree(). That might avoid other gotchas too.
|
|
Oversight
|
|
'is_menuconfig' is set after 'item' in the other cases.
|
|
Extending the scope of is_menuconfig so that it's True for all items
whose children should be displayed in a separate menu turns out to be
handy when implementing menuconfig-like functionality.
Keep the old name for backwards compatibility. It's good enough.
|
|
This is redundant from an evaluation perspective, as && has higher
precedence than ||, but is easier to read.
A && B || C && D is now rendered as "(A && B) || (C && D)".
|
|
This is redundant on its own, as only a single symbol can be
selected/implied, meaning just .name will work fine too. It means that
all symbols appearing in the __str__() representation of symbols and
choices are now printed via expr_str() though, which might come in handy
soon.
|
|
- Detect Symbol directly instead of as (not tuple) + (not choice)
- Test explicitly for a tuple (non-Symbol) in NOT
- Add some tests to get better coverage for NOT and parentheses
|
|
- Rename to name_and_loc(), to be consistent with the kconfiglib.py
version
- Use a comment instead of a docstring. Shorten the description a bit
too.
- Piggyback a missing # in conf3 in the module docstring. Typo.
|
|
This has no effect.
Model the warning on the one for selecting a symbol with unsatisfied
dependencies.
This is a Kconfiglib-exclusive warning so far.
|
|
|
|
Bit shorter, still clear in context.
|
|
Simplify the looping and remove some comments that aren't super helpful.
Also put " - " at the beginning of the lines listing the selecting
symbols. Bit more readable.
|
|
A valid int/hex user value can never be an empty string, so they test
can be simplified.
|
|
The Kconfig object is replaced immediately after it.
|
|
Example warning:
warning: user value 0x100 on the hex symbol HEX (defined at Kconfig:18) ignored due to being outside the active range ([0x13, 0x73]) -- falling back on defaults
This is a Kconfiglib-exclusive warning. It might be tricky to implement
in the C tools, due to weird two-phase handling of int/hex symbols.
There is unfortunately no easy way to map the warning back to a .config
line, as the active 'range' can't be known in general until the entire
configuration has been read (consider 'range 0 10 if FOO' for example).
Instead, the warning is generated when the symbol value is calculated.
|
|
set_value() already rejects invalid int/hex values, so there's no need
to check the value in str_value().
|
|
|
|
No need to create a list. glob() just does list(iglob()) internally as
well.
|
|
There's no need to handle prompts like defaults, selects, etc. in
_parse_properties(), because prompts belong to menu nodes, which means
only local dependencies will be propagated anyway.
Makes the code a bit less twisty.
|
|
Consistent with how dependencies are propagated elsewhere.
Get rid of the 'parent_dep' variable too.
|
|
|
|
|
|
Bit more readable to have the parent node and the previous node next to
each other.
Also rename 'prev_node' to just 'prev', to be consistent with 'parent'.
There's fewer parameters than in the past now, making it pretty easy to
follow anyway. Remove some inline parameter-related comments too.
|
|
- Restructure the test.
- Call the function _int_hex_ok() instead. Bit less spammy. Also add a
doc-comment to explain it.
|
|
'left' is guaranteed to be 'sym' if the preceding conditional was true.
|
|
Also rename it to _auto_menu_dep().
|
|
Originally taken from the C implementation, but seems pointless. The
only way to get an empty prompt text is to explicitly define a symbol
with e.g. 'prompt ""'.
|
|
Works like menuconfig.py, but just dumps the tree, with a specified
.config file as base. Handy for diffing.
|
|
Only adds daac69d ("Add a globbing source statement").
'gource' doubles as an include-if-exists function.
|
|
Removed in linux-next.
|
|
A menuconfig implementation built on top of Kconfiglib using TkInter.
|
|
Just for completeness.
|
|
|
|
'gsource' works like 'source', but takes a glob pattern and sources all
matching files. Works as a no-op if no files match, and hence doubles as
an include-if-exists function, similar to '-include' in 'make'.
Add a 'grsource' statement as well, mirroring 'rsource'.
Came up in https://github.com/ulfalizer/Kconfiglib/pull/40.
|
|
|
|
Includes a small API behavior change, hence the major version bump:
- db63301 ("Return "" for unwritten symbols in Symbol.config_string")
New features:
- Support for incremental builds using the same scheme as the
include/config/ directory in the C tools. See the new
Kconfig.sync_deps() function and commit 378dedc ("Add support for
incremental builds").
- Minimal configuration (defconfig) writing, generating identical files
to the C implementation. See commit 652f11b ("Add minimal
configuration file generation support").
The C 'make savedefconfig' implementation is currently broken in
obscure cases involving tristate choices (due to broken invalidation
code), so the tests are disabled for now. I have a patch for the C
implementation that I will submit.
Fixes:
- user_value wasn't set for choice symbols set to y via load_config()
with replace=True. Fixed by commit 0bd841d ("Properly remember y user
values for choice symbols"). Didn't affect correctness, only the API.
Other changes:
- 778ec47 ("Only write '# CONFIG_FOO is not set' for visible symbols")
mirrors a change I made to the C tools.
- bbe3ae9 ("Do not write the defconfig_list symbol to .config") mirrors
another change made to the C tools.
- Misc. refactoring and cleanup.
|
|
Works like 'make savedefconfig' in the C tools. Call it
write_min_config() rather than write_defconfig() to be a bit more
explicit.
Add a test similar to test_defconfig that compares Kconfiglib minimal
configuration output against the C implementation, for all defconfig
files.
Disable the tests for now. The C tools have a bug that causes an
incorrect configuration to be generated for tristate choices in some
cases. They will be re-enabled once those are fixed.
|
|
Commit e8b4ecb ("Don't special-case user_value for choice symbols set to
y") was meant to make user_value reflect an y value assigned to a choice
symbol, but didn't get it right for load_config() with replace=True: The
user value was set at first, but was then unset again due to a misplaced
'_was_set = True' assignment.
This commit makes y choice symbol user values always be remembered. The
correctness of generated files was not affected, since the user
selection of a choice is actually remembered as Choice.user_selection.
The previous commit just turned into a no-op for load_config() with
replace=True.
|