| Age | Commit message (Collapse) | Author |
|
Configuration files generated by --config-out would usually be an
internal detail of the build system, so it's probably not helpful to
generate *.old files for them. Pass save_old=False to write_config() to
skip it.
|
|
|
|
|
|
- Commit 3cc2f9f ("listnewconfig: Add script") adds
'make listnewconfig' functionality. The new script is bundled in the
pip install.
- Commit 78073d6 ("Preserve symlinks when writing .config.old files")
avoids stomping on symlinks when writing configuration files.
|
|
if .config is a symlink, then the intention is probably to overwrite the
target, but rename()ing the symlink to .config.old interferes with that.
Use the shutil.copyfile() fallback instead if .config is a symlink.
|
|
Mirrors 'make listnewconfig' in the C tools.
|
|
Adds two improvements related to configuration files:
- Commit 166be7d ("Save existing configuration to .<filename>.old in
write_config()")
- Commit 7b4f72f ("Make {load,write}_config(filename=None) implement
the standard behavior")
|
|
Make the previously obligatory 'filename' argument to load_config() and
write_config() default to None, and have that implement the behavior
you'd usually want: read/write either KCONFIG_CONFIG or ".config" if
unset, and read the 'option defconfig_list' configuration file if
KCONFIG_CONFIG/".config" doesn't exist.
For load_config(), filename=None also allows the configuration file to
be missing without raising an error. load_config() returns True if a
local configuration file was loaded, which is useful to check in the
menuconfig (if no local configuration file exists, we always want to
prompt for saving the configuration when exiting).
Also add a 'verbose' argument (default True) to load_config() and
read_config() that makes them print which files were read/written in
filename=None mode.
Also generalize olddefconfig.py and oldconfig.py to not require there to
already be a local configuration file. This was a bit silly for
olddefconfig.py in particular.
Remove the examples/defconfig.py script. It's a duplicate of
olddefconfig.py.
|
|
Add a default-True 'save_old' flag to write_config(). If 'save_old' is
True and an existing configuration file is being overwritten, a copy of
the old configuration file is saved to .<filename>.old (e.g.
.config.old) in the same directory.
Errors are ignored, as the old configuration would usually just be a
nice-to-have, and not essential.
The same functionality could be added for minimal configuration files
and headers, but it's probably most useful for configuration files.
|
|
|
|
Consistent with elsewhere.
|
|
These type sanity checks have never hit once during development over the
years, and were inconsistently applied too. Remove them to simplify the
code.
Keep the InternalError exception for backwards compatibility, in case
something catches it.
|
|
Adds a small incremental building improvement: commit a4751b5 ("Flag
removed symbols as changed in sync_deps()")
|
|
If a symbol is removed from a Kconfig file, it makes sense to flag it as
changed, so that things that still (probably accidentally) depend on it
get rebuilt.
Saw a patch for the C tools with the same effect floating around, so
might as well add it already. The C tools had other brokeness as well
though...
|
|
Adds commit 567cccf ("Tighten up help text parsing"), which improves
parsing performance slightly.
|
|
Get rid of _indentation() and inline it into _parse_help(), adding some
simplifications and optimizations along the way.
Saves a few % of parsing of time. Help text parsing is surprisingly hot.
|
|
Adds commit b3f0061 ("menuconfig: Only list duplicated choice symbols
once"), which improves the behavior of the menuconfig interface for an
obscure situation involving named choices included multiple times.
|
|
One thing that irks me a bit about it is that it might give the idea
that menuconfigs have to include it, making things seem more complex
than they really are.
|
|
The thing it's talking about usually happens when some file with a named
choice is included multiple times with different dependencies.
|
|
|
|
When a Kconfig file defined a named choice and was included multiple
times, the choice symbols were listed multiple times in the menuconfig
as well (due to commit 17d7c1e ("menuconfig: Show all symbols at each
menu location for multi.def. choices")).
That's probably not what you want. Tweak it so that each symbol is only
shown once, with the prompt that was used for it at whatever choice
definition location is entered.
Also change how the choice selection is displayed before the choice is
entered, so that the prompt used for the selected symbol at that
particular location is used. Previously, the prompt at the first
definition location for the symbol was always used.
(Note that all of this is only about how things are displayed. It's not
essential to functionality, in case you're writing your own menuconfig.)
|
|
Adds some small performance optimizations:
- Commit 120f551 ("Speed up more token membership tests")
- Commit bb7044c ("Reorder some tuples to put y first")
|
|
Python 3.7 has finally caught up with Python 2.7 performance-wise.
|
|
CONFIG_FOO=y and 'default y' and the like are more common than the n
versions, so test for them first.
Turning the tuples into sets would be even better on Python 3, as it
optimizes sets with constant keys into a LOAD_CONST, but it has a
performance penalty on Python 2.
|
|
Similar change to commit 4b23936 ("Speed up some token tests"), just for
more tests.
This especially helps for the "not a property line" case in
_parse_properties(), which checks against all the cases.
Saves 2-3% of parsing time together with the earlier change.
|
|
|
|
Turn some of the hotter membership test tuples into global sets, like
was already done for _TYPE_TOKENS. That saves some global lookups for
the tuple members and avoids repeatedly recreating tuples. It's 30%-50%
faster in a microbenchmark, even for two-element tuples (with global
lookups for the members).
|
|
Factors out some code.
Also use a quick 'is not UNKNOWN' test first inside it, which will
usually fail, since single-def symbols are more common. That avoids
building a tuple too.
|
|
Adds commit 67ce4eb ("Use constants when _tokens_i is known"), which
adds more optimizations made possible by switching to more manual token
handling.
|
|
Same deal as for the initial token, except we sometimes know that we're
dealing with the second token as well.
Inline _expect_nonconst_sym_and_eol() and _expect_str(), which are
single-use. That allows more specific error messages to be used as well.
Also tweak an outdated comment in _tokenize() re. None-termination.
Token fetching is more manual now.
|
|
Adds a small missed optimization opportunity, in commit 74ce9d3
("Optimize fetching of initial token on line").
|
|
|
|
Another possible optimization was missed in commit ab89ef6 ("Get rid of
_next_token() and _peek_token()"): The index of the initial token on a
line is known to be 0, so there's no need to check _tokens_i.
Also reads a bit clearer.
|
|
Tightens up syntax checking and improves a warning:
- Commit 13a7bae ("Flag extra trailing tokens in all contexts") adds
checking for extra trailing tokens in a few overlooked cases.
- Commit f356ba8 ("Clarify that select/imply is a no-op for choice
symbols") clarifies the warning when selecting/implying a choice
symbol.
Parsing performance was improved slightly as well.
|
|
The warning for selecting/implying a choice symbol could be
misunderstood as saying that select/imply has no effect on choice
symbols in a particular case. Select/imply never has an effect on choice
symbols though.
Rephrase the warning to make it clearer.
|
|
The following cases were let through without a parse error (with the
extra tokens just being ignored):
- endif/endmenu/enchoice <extra tokens>
- default FOO <extra tokens> (though 'default FOO if' flagged an
error)
Make them generate an error.
|
|
These are pretty hot. Inline them to save a few % of parsing time.
They're pretty simple anyway.
_tokens_i was initialized to -1 to simplify the _next_token()
implementation. With _next_token() gone, initialize it to 0 instead,
which simplifies some other code.
|
|
The KCONFIG_WARN_UNDEF test often fails on Python 3.4 (3.5 not tested),
but the output is still correct. It just differs due to dict ordering
randomness.
Python 3.6 iterates over dicts in insertion order in practice, and
Python 3.7 made it part of the spec, so enable the test for 3.6 and
later.
Python 2.7 seems fine as well.
|
|
- Commit ee25489 ("menuconfig: Print '----' instead of '---> (empty)'")
makes the menuconfig display empty menus (e.g. from disabled
'menuconfig' symbols) in a less spammy way, matching the C tools.
- Commit 6313925 ("Remove message re. Kconfiglib 10 backwards compat.
break") removes an old message printed when the top-level Kconfig
file can't be opened and $srctree is set. Hopefully it's been noticed
by now.
- Commit a1a4430 ("Use 'foo.__class__ is Bar' instead of
'isinstance(foo, Bar)'") improves parsing and evaluation performance a
bit.
|
|
They're either proper menus, choices, or 'menuconfig' symbols.
|
|
|
|
This matches the C tools and is a bit less spammy. Maybe it's less clear
what it means at a glance, but it's probably less confusing for disabled
'menuconfig' symbols at least.
|
|
Helps to have a fancier example too.
|
|
The message has been in for three months now. Hopefully that was enough
for it to get noticed.
|
|
This is 30%-60% faster for both the matching and non-matching case, as
measured with timeit on Python 2.7 and 3.6, and saves at least a few
percent of total parsing time (and probably some evaluation time too).
isinstance(foo, tuple) is particularly slow.
Symbol and Choice instances are always created by us, so potential
subclassing shouldn't be a problem.
|
|
Adds commit df61771 ("menuconfig: Never snap scroll back to
max_scroll"), which fixes a small menuconfig UI nit.
Add 'configuration-management' as a tag to setup.py as well.
|
|
|
|
When scroll > max_scroll (blank space at the bottom of the menu, and
also scrolled down), moving the cursor down would snap the scroll back
to max_scroll, with a small annoying jump. This could happen when going
into show-all mode and moving the cursor down near the bottom of a menu,
for example.
Fix it by leaving the scroll as-is when scroll >= max_scroll (increasing
it by one otherwise).
|
|
Move the addition of the visible child nodes and use += instead of
extend().
|
|
Not noticeable performance-wise, but a bit neater.
|