summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-02-11Make 10.37.0 releasev10.37.0Ulf Magnusson
Adds a utility for setting configuration values from the command line, in commit 22d3cc3 ("setconfig: Add script").
2019-02-11setconfig: Add scriptUlf Magnusson
This is a simple script for updating configuration values from the command line, with (optional) checking that the assigned value matches the actual symbol value afterwards (which it might not if there are unsatisfied dependencies). Sample usage: $ setconfig FOO_SUPPORT=y BAR_BITS=8 This is useful for patching the configuration in automated build systems, in a way that's safer than directly patching configuration files.
2019-01-15setup.cfg formatting nitUlf Magnusson
2019-01-15Bump latest version to 10.36.0 in READMEUlf Magnusson
Forgot when pushing out the release.
2019-01-15Make 10.36.0 releasev10.36.0Ulf Magnusson
Adds commit c9c7f59 ("Package LICENSE.txt in source distributions and wheels"), by request. Maybe some distros require this.
2019-01-15Package LICENSE.txt in source distributions and wheelsUlf Magnusson
Some distros might require this. Fixes https://github.com/ulfalizer/Kconfiglib/issues/65.
2019-01-15Update copyright years for 2019Ulf Magnusson
2018-12-24Make 10.35.0 releasev10.35.0Ulf Magnusson
- Commit 3a3559f ("menuconfig: Prompt for save if a different .config would be saved") improves the behavior of menuconfig.py when Kconfig files are modified between sessions, fixing issue #63. Modifying Kconfig files in a way that would affect the written .config now always makes the menuconfig prompts for saving the configuration on exit. A new Kconfig.missing_syms attribute is added as well, which was needed to implement the improved behavior with public APIs. - Commit b64c961 ("Warn for '# CONFIG_FOO is not set' when FOO is referenced but undefined") fixes a small oversight re. the assignment-to-undefined-symbol warning.
2018-12-24Warn for '# CONFIG_FOO is not set' when FOO is referenced but undefinedUlf Magnusson
Due to an oversight, '# CONFIG_FOO is not set' with FOO undefined only triggered a warning about assigning an undefined symbol if FOO was never referenced inside the Kconfig files.
2018-12-24menuconfig: Prompt for save if a different .config would be savedUlf Magnusson
Previously, menuconfig.py only prompted for saving the configuration if .config didn't exist or the user changed symbol values within the interface. Also make it prompt for save if Kconfig symbols have been added, removed, or have had their defaults changed, provided it would make the saved .config differ from the loaded one. This usually won't matter for correctness, because loading an outdated configuration performs an implicit olddefconfig, but it's less confusing. Also add a Kconfig.missing_syms attribute that records all assignments to undefined symbols in the most recently loaded .config file. This is needed to implement the check for whether the saved .config would be different. As an unrelated change, always prompt for saving if a .config has been loaded from within the menuconfig interface. The intention is probably often to save the configuration somewhere else, even if it isn't modified.
2018-12-15Make 10.34.0 releasev10.34.0Ulf Magnusson
Adds commit dcb6f12 ("menuconfig: Add show-help mode"), which adds a new mode to the menuconfig that replaces the key listing at the bottom with the help text of the selected item.
2018-12-15menuconfig: Add show-help modeUlf Magnusson
Pressing F toggles show-help mode, where the help window at the bottom displays the help text of the currently selected item, if any. Can be handy when browsing through symbols. Also mention the different modes that are available in the module docstring.
2018-12-15Simplify _decoding_error() a bitUlf Magnusson
Also add quotes around the filename.
2018-12-15Make 10.33.0 releasev10.33.0Ulf Magnusson
Adds an error reporting improvement and an example code fix: - Commit 0266924 ("Improve error for missing endchoice/endif/endmenu") - Commit a88302b ("Fix user-defined preprocessor function example code") Some minor performance improvements are included as well.
2018-12-15Fix user-defined preprocessor function example codeUlf Magnusson
The functions must be defined before they can be put into 'functions'.
2018-12-15Improve error for missing endchoice/endif/endmenuUlf Magnusson
Say what was expected in the error message.
2018-12-15Store file.readline in _readline instead of having _fileUlf Magnusson
Gets rid of some lookups. A bigger hotspot is all the _next_line() calls though. Wonder if there's some nice restructuring to avoid them. Getting rid of the _reuse_tokens flag would be nice too.
2018-12-15Tighten up _next_line()Ulf Magnusson
self._line is only used for error reporting, and the empty string returned at EOF would never be shown. Move the assignment to after readline() and use a local variable to hold the line instead, to get rid of some property lookups.
2018-12-15Check isspace() before EOF in _parse_help()Ulf Magnusson
More common. isspace() returns False for empty strings.
2018-12-09Make 10.32.2 releasev10.32.2Ulf Magnusson
Adds commit be3c682 ("Clarify that load_config()'s filename argument defaults to None"), which fixes a small documentation bug.
2018-12-09Clarify that load_config()'s filename argument defaults to NoneUlf Magnusson
Had missed the '(default: None)', and it doesn't hurt to point it out in the description either. Point out that filename=None is the default in the write_config() 'filename' description too, though it already had the '(default: None)'.
2018-12-08Make 10.32.1 releasev10.32.1Ulf Magnusson
Adds commit e8f9751 ("genconfig: Do not generate *.old files for --config-out"), which gets rid some probably redundant .config.old files.
2018-12-08genconfig: Do not generate *.old files for --config-outUlf Magnusson
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.
2018-12-08_save_old() code nitsUlf Magnusson
2018-12-08Simplify 'verbose' check in write_config()Ulf Magnusson
2018-12-08Make 10.32.0 releasev10.32.0Ulf Magnusson
- 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.
2018-12-08Preserve symlinks when writing .config.old filesUlf Magnusson
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.
2018-12-08listnewconfig: Add scriptUlf Magnusson
Mirrors 'make listnewconfig' in the C tools.
2018-12-08Make 10.31.0 releasev10.31.0Ulf Magnusson
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")
2018-12-08Make {load,write}_config(filename=None) implement the standard behaviorUlf Magnusson
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.
2018-12-08Save existing configuration to .<filename>.old in write_config()Ulf Magnusson
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.
2018-12-07menuconfig: Code formatting nitUlf Magnusson
2018-12-07Rename 'val_sym' to 'sym' in str_value()Ulf Magnusson
Consistent with elsewhere.
2018-12-07Remove _internal_error()Ulf Magnusson
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.
2018-12-01Make 10.30.0 releasev10.30.0Ulf Magnusson
Adds a small incremental building improvement: commit a4751b5 ("Flag removed symbols as changed in sync_deps()")
2018-12-01Flag removed symbols as changed in sync_deps()Ulf Magnusson
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...
2018-12-01Make 10.29.0 releasev10.29.0Ulf Magnusson
Adds commit 567cccf ("Tighten up help text parsing"), which improves parsing performance slightly.
2018-12-01Tighten up help text parsingUlf Magnusson
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.
2018-11-28Make 10.28.0 releasev10.28.0Ulf Magnusson
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.
2018-11-28menuconfig: Clarify the scope of the named choice special-casingUlf Magnusson
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.
2018-11-28menuconfig: Improve comment re. multiply-defined choice symbolsUlf Magnusson
The thing it's talking about usually happens when some file with a named choice is included multiple times with different dependencies.
2018-11-28menuconfig: Fix variable name typo in commentUlf Magnusson
2018-11-28menuconfig: Only list duplicated choice symbols onceUlf Magnusson
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.)
2018-11-26Make 10.27.0 releasev10.27.0Ulf Magnusson
Adds some small performance optimizations: - Commit 120f551 ("Speed up more token membership tests") - Commit bb7044c ("Reorder some tuples to put y first")
2018-11-26Recommend Python 3Ulf Magnusson
Python 3.7 has finally caught up with Python 2.7 performance-wise.
2018-11-26Reorder some tuples to put y firstUlf Magnusson
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.
2018-11-26Speed up more token membership testsUlf Magnusson
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.
2018-11-25Whitespace nitUlf Magnusson
2018-11-25Speed up some token testsUlf Magnusson
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).
2018-11-25Move _TOKEN_TO_TYPE conversion into _set_type()Ulf Magnusson
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.