summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-27Make 3.2.0 releasev3.2.0Ulf Magnusson
Adds a Kconfig extension contributed by RomaVis: aea0232 ("Implement 'rsource' statement ('source' with relative path)").
2018-02-27Implement 'rsource' statement ('source' with relative path)Roman
The 'rsource' statement works like 'source', but looks relative to the Kconfig file that has the 'rsource' rather than relative to the base Kconfig file. Using 'rsource' makes it possible to move subtrees with Kconfig files around without breaking references to other Kconfig files. So far, this is a Kconfiglib-exclusive feature.
2018-02-25Clarify the purpose of _STRING_LEXUlf Magnusson
The main purpose of _STRING_LEX is being able to tell strings from constant symbol references during tokenization. The old comment was implying that its only purpose is handling the "missing quotes" in e.g. source foo/Kconfig Update the comment to make _STRING_LEX clearer.
2018-02-25menuconfig.py: More style and comment nitsUlf Magnusson
- Use generator expression rather than list comprehension - Fix dubious English
2018-02-25menuconfig.py: Style and comment nitsUlf Magnusson
2018-02-23menuconfig.py: Remove unused STR_TO_TRI importUlf Magnusson
Piggyback a small note to clarify that symbols defined without a type are pretty obscure.
2018-02-16Make 3.1.0 releasev3.1.0Ulf Magnusson
Only includes 2a88c0c ("Include direct deps. in Symbol/Choice.__str__()").
2018-02-16Include direct deps. in Symbol/Choice.__str__()Ulf Magnusson
Direct dependencies are significant for 'imply' even if the symbol has no properties, so they need to be included to get semantically equivalent output. Making the direct dependencies clear is helpful in general too, even if you can usually infer them from the properties they get propagated to.
2018-02-09oldconfig.py style nitsUlf Magnusson
2018-02-09Simplify tri_value_str() in oldconfig.pyUlf Magnusson
2018-02-09Simplify visibility check in Choice._get_selection()Ulf Magnusson
The visibility of a symbol in an y-mode choice can only be n or y, so it's sufficient to check that it's not n (0).
2018-02-08oldconfig.py comment nitUlf Magnusson
2018-02-08Give hint about recognizing undefined symbolsUlf Magnusson
2018-02-08README nitUlf Magnusson
Might've sounded a bit snarky -- wasn't meant to.
2018-02-08Fix typo in module docstringUlf Magnusson
It's the top-level Kconfig file that source's depending on $SRCARCH, not the top-level Makefile.
2018-02-08_parse_expr() docstring nitUlf Magnusson
2018-02-08Make 3.0.0 releasev3.0.0Ulf Magnusson
- Only includes e8b4ecb ("Don't special-case user_value for choice symbols set to y"). Since that's a tiny change to the behavior of the API, the major version is bumped.
2018-02-08Don't special-case user_value for choice symbols set to yUlf Magnusson
Previously, setting a choice symbol to y would only update user_selection on the parent choice and not the symbol's own user_value. Now both are updated. The point of the old behavior was to remember the m mode selections of a choice when it was switched back and forth between m and y mode, which was a feature I thought the C implementation had. On closer inspection, the C implementation never had that feature, though it might appear like it if you only make "lucky" changes (if you never select any symbols in y mode that were n in m mode). The new behavior is simpler and easier to understand: Symbol.user_value now always matches the value assigned in a .config file or via set_value(), provided the value was well-formed. This might avoid some special-casing in scripts too. The loss in usability is pretty minimal.
2018-02-08oldconfig.py comment nitUlf Magnusson
2018-02-08Prompt for choices with new visible symbols in oldconfig.pyUlf Magnusson
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.
2018-02-07Add back omitted $ARCH != $SRCARCH defconfig testsUlf Magnusson
Oversight during refactoring. defconfig files should be searched for in in arch/$SRCARCH/ rather than arch/$ARCH/, to account for $ARCH != $SRCARCH. Adds a few tests to test_defconfig(). Some of the ARCH/defconfig combinations might be nonsensical, but that's fine. Make all test functions take $SRCARCH as well as $ARCH, which makes the implementation straightforward.
2018-02-07Give symbol locations in merge_config.py warningsUlf Magnusson
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.
2018-02-07Make 2.7.0 releasev2.7.0Ulf Magnusson
Just adds f66cd71 ("Allow "n"/"m"/"y" as aliases for 0/1/2 in set_value()").
2018-02-07Allow "n"/"m"/"y" as aliases for 0/1/2 in set_value()Ulf Magnusson
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.
2018-02-06Add help text display feature to oldconfig.pyUlf Magnusson
Typing '??' displays the help text of the current item.
2018-02-06Refactor do_oldconfig() slightlyUlf Magnusson
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.
2018-02-06Account for earlier symbols depending on later ones in oldconfig.pyUlf Magnusson
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.
2018-02-06Consistently use 'kconf' instead of 'conf'Ulf Magnusson
The examples had some leftovers from Kconfiglib 1.
2018-02-06Add oldconfig.py example scriptUlf Magnusson
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.
2018-02-03Add example that finds references to undefined symbolsUlf Magnusson
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).
2018-02-03Refactor test suite arch Kconfig loadingUlf Magnusson
List the ARCH/SRCARCH pairs that don't conform to the arch/$ARCH/Kconfig pattern directly.
2018-02-03Set $KERNELVERSION properly in test suiteUlf Magnusson
Don't think anything currently depends on it where it would matter for the test suite, but might as well.
2018-01-30Make 2.6.0 releasev2.6.0Ulf Magnusson
This release tightens up syntax checking and adds all the warnings generated by the C implementation (plus a few extra ones), making Kconfiglib more viable as a replacement for the C tools, rather than just being an auxiliary library. Syntax checking changes: - a84848b ("Tighten up syntax checking") - 8716316 ("Generate a parse error for extra tokens at EOL") - 416083a ("Flag constant symbols where they're not allowed") Warning changes: - 9c309400 ("Add some post-parsing warnings") - da0bfa3a ("Error out for malformed hex/int/string defaults") - 5d2041a9 ("Add more choice type and prompt sanity checks") - 67f825fc ("Warn if there's more than one help text") - 990c780f ("Add some warnings related to selects and implies") - 7432ade8 ("Warn if a symbol is defined with multiple types") - 5eeea863 ("Improve int/hex sanity checking") - ad94bb45 ("Sanity-check range values") - e930c140 ("Warn if a symbol/choice has multiple prompts") - 60d12911 ("Warn if help text is empty") - d43d2e83 ("Warn if menuconfig statement has no prompt") - 3db12f72 ("Warn if a choice symbol has defaults") - 0eadd61c ("Warn if choice symbol has prompt outside choice") Also includes various code nits.
2018-01-30Fix warnings printed for test suiteUlf Magnusson
Just to have clean output. The warnings themselves are accurate.
2018-01-30Warn if choice symbol has prompt outside choiceUlf Magnusson
Defining a choice symbol in multiple places to add some properties to it outside the choice seems to actually be done deliberately by MIPS, but it's almost guaranteed to be an error if the definition(s) outside the choice have a prompt (and so can be changed by the user there), so warn for that.
2018-01-29Warn if a choice symbol has defaultsUlf Magnusson
Never has en affect.
2018-01-29Warn if menuconfig statement has no promptUlf Magnusson
Mirrors a warning in the C implementation.
2018-01-29Give tip about getting rid of warningsUlf Magnusson
The empty-help warning is pretty spammy at the moment.
2018-01-29Warn if help text is emptyUlf Magnusson
Personal pet peeve. Should add a warning to the C implementation too.
2018-01-29Refactor _check_sym_sanity()Ulf Magnusson
Arrange by type, which works pretty neatly except for the pesky ranges check. This also makes us do less work in the common BOOL/TRISTATE case. Get rid of _check_select_imply_sanity().
2018-01-29Move sym.ranges check to end of _check_sym_sanity()Ulf Magnusson
More important stuff up front.
2018-01-29Warn if a symbol/choice has multiple promptsUlf Magnusson
In a single location. Having multiple definitions with different prompts is okay.
2018-01-29Sanity-check range valuesUlf Magnusson
Must have a form compatible with the int/hex, like for defaults. Also refactor a bit and use a single _int_hex_value_is_sane() helper. Less duplication.
2018-01-29Improve int/hex sanity checkingUlf Magnusson
If a non-constant default is given, we can still check that it has the right type. Break out two int/hex value sanity checking functions.
2018-01-28Warn if a symbol is defined with multiple typesUlf Magnusson
2018-01-28Remove redundant is_constant checkUlf Magnusson
Constant as well as undefined symbols lack menu nodes, so it's sufficient to check 'nodes'.
2018-01-28Add some warnings related to selects and impliesUlf Magnusson
Only bool and tristate symbols can select and be selected. Also add docstrings to the sanity checking functions.
2018-01-28Warn if there's more than one help textUlf Magnusson
Mirrors a warning I added to the C implementation.
2018-01-28Add more choice type and prompt sanity checksUlf Magnusson
- Choices should have type bool or tristate - Choice values should have a prompt Also fix indentation mess-up.
2018-01-28Refactor post-parsing sanity checkingUlf Magnusson
Have separate functions for checking symbols and choices instead of mixing them up. Easier to read, and avoids some isinstance() checks. Add some comments too.