summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-10-31Make 10.18.0 releasev10.18.0Ulf Magnusson
Commit 14603c0 ("Make errno/strerror/filename available on IOError") makes IOError/OSError.errno/strerror/filename available to scripts, when it is raised from e.g. Kconfig.load_config(). Previously, some implementation trickery related to custom exception messages meant that they weren't available.
2018-10-31Make errno/strerror/filename available on IOErrorUlf Magnusson
An error reporting flaw was that most raised IOErrors got their errno/strerror/filename fields stripped, due to wanting to show a custom messages. The problem was that adding back 'errno' and 'strerror' made IOError.__str__() always return a fixed string ("[Errno <errno>] <strerror>"), ignoring any custom message. This is friendly to users, but unfriendly to scripts (the menuconfig had a workaround). Make things friendly to both by raising an internal subclass of IOError instead, that preserves errno/strerror/filename but prints a custom message. The exception can then still be caught as IOError/OSError by scripts.
2018-10-30Simplify _INIT_SRCTREE_NOTE definitionUlf Magnusson
2018-10-30Remove no longer needed 'node.item is None' testsUlf Magnusson
After commit e0256b6 ("Have MENU and COMMENT match _T_MENU and _T_COMMENT"), the only falsy value for node.item is None, since all token constants are truthy (since they're never 0).
2018-10-28Replace 'indent == 0' with 'not indent'Ulf Magnusson
Tiny bit faster and smaller. Clear in context.
2018-10-28Have MENU and COMMENT match _T_MENU and _T_COMMENTUlf Magnusson
Same approach as for the expression type symbolic constants. Removes a tiny bit of conversion and makes things a bit more consistent.
2018-10-28Shorten exception class definitions a bitUlf Magnusson
2018-10-28Remove leftover comment in _add_choice_deps()Ulf Magnusson
Made more sense when the code was part of _build_dep(). The same thing is explained in the function docstring now.
2018-10-28Micro-optimize dependency loop checkingUlf Magnusson
Turn the _check_dep_loop_sym lookup into a LOAD_FAST inside the loop.
2018-10-26Make 10.17.0 releasev10.17.0Ulf Magnusson
Adds commit 699fd81 ("Support enabling the assignment-to-undef. symbol warning via the environment"). This makes it possible to enable the warning for assigning an undefined symbol within a .config file, while using the bundled tools. Previously, enabling the warning required modifying the tools to call Kconfig.enable_undef_warnings().
2018-10-26Support enabling the assignment-to-undef. symbol warning via the environmentUlf Magnusson
This makes it possible to enable it for the bundled tools, by setting KCONFIG_WARN_UNDEF_ASSIGN=y. Previously, the code had to be modified to call Kconfig.enable_undef_warnings(). Also rename KCONFIG_STRICT to KCONFIG_WARN_UNDEF, for consistency. Keep supporting KCONFIG_STRICT as an alias for backwards compatibility.
2018-10-25Move _is_num() into _check_undef_syms()Ulf Magnusson
_check_undef_syms() is the only caller.
2018-10-22Make 10.16.0 releasev10.16.0Ulf Magnusson
- Commit 85ba6b2 ("menuconfig: Mention jump-to in info dialog help") makes it a bit easier to discover that jump-to can be entered from the info dialog. - Commit d920dbe ("Use standard_sc_expr_str() in _name_and_loc()") makes named choices show up as '<choice NAME>' in warnings, instead of just as 'NAME'. Some small parsing optimizations are included as well.
2018-10-22Use standard_sc_expr_str() in _name_and_loc()Ulf Magnusson
Makes choices show up as <choice (name, if any)>, which is nice. Previously, just the name was shown for named choices.
2018-10-22menuconfig: Mention jump-to in info dialog helpUlf Magnusson
Might be hard to discover that [/] works inside the info dialog otherwise.
2018-10-22Move _check_sym/choice_sanity() into the Kconfig classUlf Magnusson
This makes the calls to Kconfig._warn() a bit less awkward (self._warn() instead of sym/choice.kconfig._warn()). Also move the loops over the symbols/choices into the functions, as a small optimization.
2018-10-22Micro-optimize _make_depend_on() callsUlf Magnusson
Store the function in a local variable outside the loop in _build_dep().
2018-10-21Make 10.15.0 releasev10.15.0Ulf Magnusson
- Commit 9a4127a ("Allow programmatically expanding preprocessor functions with args") adds a Variable.expanded_value_w_args() function for calling preprocessor functions programmatically. Not being able to pass arguments to Variable.expanded_value was an oversight. - Commit 516deb4 ("menuconfig: Show the selected symbol for promptless choices") makes menuconfig show the selected symbol next to promptless choices in show-all mode. This is relevant for named choices defined in multiple locations. Some minor parsing optimizations are included as well.
2018-10-21Allow programmatically expanding preprocessor functions with argsUlf Magnusson
Add a Variable.expanded_value_w_args() function for expanding a preprocessor function with particular arguments. This is what expanded_value should have been, because expanded_value_w_args() is more general (expanded_value corresponds to zero arguments). Keep expanded_value for backwards compatibility though. Also add a simple __repr__() to Variable. It could show the expanded value, but that might mean calling shell functions or user-defined functions as a side effect (possibly with missing arguments). Not sure that's a good idea, so just show the unexpanded value.
2018-10-21Test _parse_block() blank line case earlierUlf Magnusson
Can be treated as just another case, and moved later so that the cases become sorted by frequency.
2018-10-21Sort _parse_properties() cases by frequencyUlf Magnusson
Use the Linux x86 Kconfig frequencies. Most cases were already sorted, but the blank line case was treated specially. 'imply' was checked too early too (though it's used more in some other projects).
2018-10-21Simplify node->item property copyingUlf Magnusson
Turn _add_props_to_sc() into _add_props_to_sym(), and handle choices separately, as they're trivial. This gets rid of some if's too.
2018-10-21menuconfig: Show the selected symbol for promptless choicesUlf Magnusson
If a choice is defined in multiple locations to add symbols, and show-all mode is turned on to reveal one of the promptless definitions, then it doesn't hurt to show the selected symbol next to it.
2018-10-21menuconfig: _node_str() simplification nitUlf Magnusson
2018-10-16Make 10.14.3 releasev10.14.3Ulf Magnusson
Adds commit 98af94d ("Make Kconfig.choices match its description"). Previously, Kconfig.choices was accidentally identical to Kconfig.unique_choices. It's now crappy as advertised, and keeps duplicates. Removing duplicates (while preserving order) was the original reason for adding Kconfig.unique_defined_syms and Kconfig.unique_choices. It'd be rare to need Kconfig.choices.
2018-10-16Make Kconfig.choices match its descriptionUlf Magnusson
Kconfig.choices has accidentally been identical to Kconfig.unique_choices all along, because named choices defined in multiple locations (which are pretty obscure) were only added once. Fix Kconfig.choices to match its description. This simplifies the code a bit too. Kconfig.unique_choices is usually what you want.
2018-10-16menuconfig: Use Kconfig.unique_choices in jump-toUlf Magnusson
Use Kconfig.unique_choices instead of Kconfig.choices in the jump-to dialog, as choices defined in multiple locations should only get their menu nodes added once (to avoid redundant entries). I noticed a related Kconfiglib issue while working on this: Kconfig.choices has been identical to Kconfig.unique_choices all long, so things were never actually broken. That means Kconfig.choices should be fixed to match its description though. The next commit will do that.
2018-10-15menuconfig: Simplify _sorted_menu_comment_nodes()Ulf Magnusson
Can use the same function for both sort keys, and the logic can be simplified a bit too. The += is deliberate, to do in-place modification.
2018-10-15Fix typo in _add_props_to_sc() commentUlf Magnusson
2018-10-14Make 10.14.2 releasev10.14.2Ulf Magnusson
Adds two small menuconfig improvements/fixes: - Commit 9a7b374 ("menuconfig: Fix some minor resizing jumpiness on gnome-terminal") - Commit 3d0dc9f ("menuconfig: Switch back to "very visible" cursor after Ctrl-F")
2018-10-14menuconfig: Fix some minor resizing jumpiness on gnome-terminalUlf Magnusson
gnome-terminal jerks a bit whenever the terminal is shrunk so that the row with the cursor on it disappears. This is probably gnome-terminal shoddiness, but it's pretty easy to work around by drawing stuff at the top last, so do it. No need to do it for the jump-to dialog, because the cursor is already in the edit box at the top there.
2018-10-14menuconfig: Switch back to "very visible" cursor after Ctrl-FUlf Magnusson
Was set back to "normal" instead due to a typo, which is inconsistent with the rest of the code.
2018-10-14menuconfig: Mention some ncurses ESCDELAY investigationUlf Magnusson
2018-10-14menuconfig: Mention some potential (though never seen) ESCDELAY iffinessUlf Magnusson
2018-10-14menuconfig: Mention that jump-to has been generalized in docstringUlf Magnusson
Can jump to choices, menus, and comments now as well.
2018-10-14Link ACRNUlf Magnusson
2018-10-14Make 10.14.1 releasev10.14.1Ulf Magnusson
Adds commit 63bbecb ("menuconfig: Fix crash when pressing Ctrl-F with no matches in jump-to dialog"). Ctrl-F is the view-help shortcut in the jump-to dialog.
2018-10-14menuconfig: Fix crash when pressing Ctrl-F with no matches in jump-to dialogUlf Magnusson
Ctrl-F is the jump-to dialog view-help shortcut. It needs to check whether there are any matches, like Enter/jump-to does.
2018-10-14Make 10.14.0 releasev10.14.0Ulf Magnusson
Adds two menuconfig improvements and a documentation improvement: - Commit 96682d7 ("menuconfig: Add jump-to for choices, menus, and comments") generalizes the jump-to feature so that choices, menus, and comments can be jumped to in addition to symbols (or into, in the case of choices and menus). - Commit fae2e70 ("menuconfig: Do not show range hint for symbols without ranges") despams the menuconfig interface and could potentially avoid some confusion. - Commit bde4cc7 ("Add some hints re. generating custom configuration output") adds some documentation hints re. using the Symbol.config_string field when generating custom output. It can be useful for pruning symbols even when the output format isn't .config-like.
2018-10-14menuconfig: Add jump-to for choices, menus, and commentsUlf Magnusson
For choices, search the name and the prompt. This is the same as for symbols, except names are optional (and rare) for choices. For menus and comments, search the prompt (title text). When jumping to a non-empty choice or menu, jump into it instead of jumping to its menu node. If show-all mode is off and there are visible items in the choice/menu, then jump to the first visible node. Otherwise, enable show-all and jump to the first node.
2018-10-13menuconfig: Do not show range hint for symbols without rangesUlf Magnusson
The 'no range constraints' input dialog hint for int/hex symbols might be more confusing than helpful, especially if you assume it was something the symbol author put there. Only show the range hint for symbols with active ranges instead, and show nothing for other symbols.
2018-10-13Add some hints re. generating custom configuration outputUlf Magnusson
It's not obvious that Symbol.config_string can be useful even when generating other output formats, as it provides a hook for _write_to_conf. Mention it in the 'config_string' documentation and in relevant parts of the README.
2018-10-10Make 10.13.0 releasev10.13.0Ulf Magnusson
Adds commit a247f3f ("menuconfig: Improve/fix promptless choice handling"), which fixes an obscure menuconfig crash involving symbols in promptless choices, and improves how choices are displayed in show-all/show-name mode a bit ('<choice (name, if any)>' instead of either nothing or '<name>').
2018-10-10menuconfig: Comment formatting nitsUlf Magnusson
2018-10-10menuconfig: Improve/fix promptless choice handlingUlf Magnusson
The code assumed that all parent (interface) menus always have a prompt, which is false for items in promptless choices. This lead to a crash e.g. when viewing the symbol information for a symbol within a promptless choice. Promptless choices with children can show up "legitimately" when people define choices in multiple locations to add symbols, though this is broken in the C tools. Use standard_sc_expr_str(node.item) instead of the non-existing prompt for promptless choices. That way they show up as <choice (name if any>)>, which is consistent with how they're shown elsewhere. This commit also changes how choices names are displayed in show-name/show-all mode, to the standard_sc_expr_str() format.
2018-10-08_shell_fn() comment nitUlf Magnusson
2018-10-08Remove redundant elifs in expr_value()Ulf Magnusson
Leftover from assigning a 'res' variable.
2018-10-07Remove useless local variable in _parse_factor()Ulf Magnusson
Not sure how I missed that one so long...
2018-10-06Make 10.12.0 releasev10.12.0Ulf Magnusson
Adds commit f1e4d04 ("menuconfig: Remove "Value for " prefix from input dialog titles"), which de-spams the menuconfig interface a bit. Some documentation fixes and improvements are included as well: - Commit 631c51f ("Point to IS_ENABLED() is README") - Commit f594975 ("Add hints on incremental building to 'getting started'") - Commit d044ee9 ("Clarify --config-out description a bit") - Commit 358b77a ("Hint that load_config() with replace=False is for merging") - Commit 5d15df9 ("Update genconfig usage description") The naming in some internal evaluation functions was cleaned up too.
2018-10-06Fix typo in READMEUlf Magnusson