| Age | Commit message (Collapse) | Author |
|
Move to the root, simplify a bit, provide an entry point function (for
setuptools's entry_points).
|
|
Could do something similar to allnoconfig.py for the packaged version.
|
|
Put to-be-packaged stuff in the root.
Use allnoconfig_simpler.py, and rename allnoconfig.py to
allnoconfig_walk.py and keep it as an example.
|
|
All the packaged code will appear in the root.
|
|
setuptools' 'entry_points' gives nice behavior on Windows. It requires
that the module has an entry point function. Create one and move the
command line argument handling to it.
Piggyback KCONFIG_CONFIG support, and make the script executable
(oversight).
|
|
This matches the C tools. Hadn't noticed they had the same feature.
|
|
Had missed sys.exit(msg).
|
|
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").
|
|
- 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.
|
|
Works like menuconfig.py, but just dumps the tree, with a specified
.config file as base. Handy for diffing.
|
|
- Use generator expression rather than list comprehension
- Fix dubious English
|
|
|
|
Piggyback a small note to clarify that symbols defined without a type
are pretty obscure.
|
|
|
|
|
|
|
|
|
|
It makes sense to prompt for a choice during oldconfig if it contains
new visible symbols, even if there is already an old visible user
selection.
|
|
Helpful for debugging.
Piggyback some small fixes:
- Don't imply that merge_config.py is an executable file or that it
only runs under Python 3. Remove the hashbang line and fix the
example in the overview.
- Add some #'s to the overview .config files that had accidentally been
left out.
- Fix a questionable sentence in oldconfig.py's name_and_loc_str()
docstring.
|
|
More experience working with the API convinced me that it's worth it.
Gets rid of ugly conversions in the menuconfig.py and oldconfig.py
examples, and streamlines some things internally as well.
Include two other small fixes as well:
- Make warnings generated by Choice.set_value() match those generated
by Symbol.set_value().
- Get rid of the input stripping in menuconfig.py. It's not like the
interface is usable as-is anyway, and it just complicates the
example.
|
|
Typing '??' displays the help text of the current item.
|
|
Not sure why anyone would want to oldconfig just a part of the
configuration tree, especially as there might be dependencies pointing
outside of it. Take a Kconfig object instead of a node.
|
|
The oldnoconfig operation needs to be rerun if the value of any symbol
changes, to catch cases where symbols depend on symbols defined after
them. Otherwise the earlier symbols will just get their default value
instead of being prompted for.
|
|
The examples had some leftovers from Kconfiglib 1.
|
|
Implements the standard 'make oldconfig' functionality, prompting the
user for the values of new symbols to update an old .config file.
This came up in
https://github.com/zephyrproject-rtos/zephyr/issues/5426.
|
|
Does a global search over all architectures in the kernel, which should
avoid false positives.
Referencing an undefined symbol in a particular architecture can be fine
in a Kconfig file that's shared by multiple architectures, but if the
symbol isn't defined by any architecture, it's likely to be an error (or
a potential cleanup).
|
|
Functions similarly to scripts/kconfig/merge_config.sh from the kernel.
Came up in https://github.com/zephyrproject-rtos/zephyr/pull/5417.
|
|
Copy-paste error.
Piggyback error message consistency nit for help_grep.py.
|
|
|
|
- Remove redundant parentheses in indent_print().
- Use unnumbered replacement fields with format().
|
|
Leftovers
|
|
No need to use a dictionary.
|
|
Preferred method, should 'option modules' be properly supported later.
|
|
Clean up some formatting a bit too.
|
|
Pointless as an optimization here. Should restrict obfuscating
micro-optimization to the library code too even where it helps.
|
|
Confirms that all the examples that aren't tested in the test suite at
least run. Easy to miss brokenness there. Output can be inspected
manually (it'll vary depending on the kernel version).
Fix defconfig_oldconfig.py, which hadn't been properly updated for the
new API.
|
|
|
|
Turns out to be kinda awkward to implement print_tree.py iteratively,
because the indent.
|
|
conf -> kconf, for consistency, plus various nits.
|
|
Can be implemented in a simpler/better way with Choice.assignable.
Also rename 'conf' to 'kconf' in allnoconfig.py for consistency.
|
|
|
|
Don't need to handle them at all now that .assignable doesn't claim that
choice symbols in y-mode choices can be set to n. 20/20 hindsight.
|
|
Argument must be "X86" to get that output. "x86" just returns some
constant symbols.
|
|
Demonstrates expression fetching and walking. Basically a much better
version of get_ref_locations() from Kconfiglib 1, now that the user API
is flexible enough to implement it.
Should be it for new examples before release.
|
|
|
|
Handy for running menuconfig.py
|
|
|
|
Also avoid printing (None) as the name for unnamed (normal) choices.
|
|
Still needs documentation and some cleanup.
Interface deliberately kept super simple/clunky to focus on the
concepts. Not something you'd actually want to use.
Sample session:
$ python Kconfiglib/examples/menuconfig.py Kconfiglib/examples/Kmenuconfig
======== Example Kconfig configuration ========
[*] Enable loadable module support (MODULES)
Bool and tristate symbols
[*] Bool symbol (BOOL)
[ ] Dependent bool symbol (BOOL_DEP)
< > Dependent tristate symbol (TRI_DEP)
[ ] First prompt (TWO_MENU_NODES)
< > Tristate symbol (TRI)
[ ] Second prompt (TWO_MENU_NODES)
*** These are selected by TRI_DEP ***
< > Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
< > Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
String, int, and hex symbols
(foo) String symbol (STRING)
(747) Int symbol (INT)
(0xABC) Hex symbol (HEX)
Various choices
-*- Bool choice (BOOL_CHOICE)
--> Bool choice sym 1 (BOOL_CHOICE_SYM_1)
Bool choice sym 2 (BOOL_CHOICE_SYM_2)
{M} Tristate choice (TRI_CHOICE)
< > Tristate choice sym 1 (TRI_CHOICE_SYM_1)
< > Tristate choice sym 2 (TRI_CHOICE_SYM_2)
[ ] Optional bool choice (OPT_BOOL_CHOICE)
Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): BOOL
Value for BOOL (available: n, y): n
======== Example Kconfig configuration ========
[*] Enable loadable module support (MODULES)
Bool and tristate symbols
[ ] Bool symbol (BOOL)
< > Tristate symbol (TRI)
[ ] Second prompt (TWO_MENU_NODES)
*** These are selected by TRI_DEP ***
< > Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
< > Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
String, int, and hex symbols
(foo) String symbol (STRING)
(747) Int symbol (INT)
(0xABC) Hex symbol (HEX)
Various choices
-*- Bool choice (BOOL_CHOICE)
--> Bool choice sym 1 (BOOL_CHOICE_SYM_1)
Bool choice sym 2 (BOOL_CHOICE_SYM_2)
{M} Tristate choice (TRI_CHOICE)
< > Tristate choice sym 1 (TRI_CHOICE_SYM_1)
< > Tristate choice sym 2 (TRI_CHOICE_SYM_2)
[ ] Optional bool choice (OPT_BOOL_CHOICE)
Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): MODULES
Value for MODULES (available: n, y): n
======== Example Kconfig configuration ========
[ ] Enable loadable module support (MODULES)
Bool and tristate symbols
[ ] Bool symbol (BOOL)
[ ] Tristate symbol (TRI)
[ ] Second prompt (TWO_MENU_NODES)
*** These are selected by TRI_DEP ***
[ ] Tristate selected by TRI_DEP (SELECTED_BY_TRI_DEP)
[ ] Tristate implied by TRI_DEP (IMPLIED_BY_TRI_DEP)
String, int, and hex symbols
(foo) String symbol (STRING)
(747) Int symbol (INT)
(0xABC) Hex symbol (HEX)
Various choices
-*- Bool choice (BOOL_CHOICE)
--> Bool choice sym 1 (BOOL_CHOICE_SYM_1)
Bool choice sym 2 (BOOL_CHOICE_SYM_2)
-*- Tristate choice (TRI_CHOICE)
--> Tristate choice sym 1 (TRI_CHOICE_SYM_1)
Tristate choice sym 2 (TRI_CHOICE_SYM_2)
[ ] Optional bool choice (OPT_BOOL_CHOICE)
Enter a symbol/choice name, "load_config", or "write_config" (or press CTRL+D to exit): ^D
Unsetting modules demonstrates one reason why it makes sense to have
.type be magic and change from TRISTATE to BOOL without modules
(<> = tristate, [] = bool). The C implementation uses the same trick.
(The original type is still available in .orig_type though.)
Piggyback printing of tristates as n, m, y in the warning for invalid
values in set_value().
|
|
_cached_vis is always calculated as a side effect of calculating any
other cached value, and so doubles as a flag for whether an item (symbol
or choice) has any cached values.
If _cached_vis is None for some item, it also indirectly means that no
other item can have any cached values that (actually) depend on the
item, because _cached_vis would have gotten calculated as a side effect
of calculating any such cached value. Therefore, it's safe to stop
recursive invalidation at an item that has _cached_vis None.
Huge speedup for the allyes/noconfig*.py scripts. allnoconfig_simpler.py
went from 2.671 seconds to 1.067 seconds.
The dependency selftests need to be updated too now that
_get_dependent() is gone. The kernel defconfig tests pass even if all
global invalidation is disabled at least (except for the few defconfigs
that don't set MODULES=y), and that's a huge invalidation test. Seems
pretty speedy too, even though there's some redundant work, so maybe
things could be simplified a bit...
|