| Age | Commit message (Collapse) | Author |
|
Adds commit 0c79d23 ("menuconfig: Be silent when changing LC_CTYPE to a
UTF-8 locale").
|
|
|
|
It's pretty subtle that sym.config_string can be used instead of the
internal sym._write_to_conf variable in client code. Mention it in
comments near where _write_to_conf is used.
Seen client code access _write_to_conf a few times now. No plans to
remove it though, so it'll most likely keep working.
|
|
Same behavior, simpler.
|
|
Adds a small error message improvement, in commit 49831dd ("Give the
'source ...' line being parsed when a file can't be opened").
|
|
Bit cleaner-looking.
|
|
Helpful when env. variables are involved. Previously only shown when the
file couldn't be found.
|
|
Factors out some common code.
|
|
Adds a genconfig feature that can be used to avoid needless
reconfiguration, and improves the dumpvars output format.
- Commit dd1be54 ("genconfig: Support generating lists of files and
environment vars.")
- Commit f503ea3 ("dumpvars: Make the output format copy-pasteable")
|
|
This can be useful to avoid needless reconfiguration, by checking if any
Kconfig file or environment variable has changed value before running
genconfig.
|
|
Adds commit 443e6bb ("menuconfig: Fix help display on Python 2").
|
|
Do the opposite of what other people are doing and make menuconfig.py
Python 2-compatible. Turns out it's not that tricky after all, and it
makes everything consistently Python 2/3-compatible and streamlines
things.
- Commit 41b5891 ("menuconfig: Get rid of 'nonlocal'")
- Commit b2e211d ("menuconfig: Fall back on getch() when get_wch()
isn't available")
- Commit c3162be ("menuconfig: Only decode curses.erasechar() on Python
3")
- Commit fe6ed99 ("menuconfig: Import print_function for Python 2
compatibility")
- Commit c209188 ("menuconfig: Have hashbang point to 'python' instead
of 'python3'")
- Commit d577865 ("Remove Python 3 menuconfig special-casing from
Makefile patch")
- Commit 319f7f0 ("Update various comments now that menuconfig is
Python 2-compatible")
- Commit 5fbd70e ("Update setup.py now that menuconfig is Python
2-compatible")
Also investigate exactly what the Python version requirements are and tweak
and document things a bit:
- Commit e0baa79 ("Tweak python_requires to 2.7/3.2+")
- Commit 3a772a6 ("Add a section on version compatibility to the
README")
|
|
|
|
Adds commit 22f2778 ("Mention that the load_config() message is
different for replace=False")
|
|
Handy to know when writing merging utilities.
|
|
Catch Exception instead, which avoids catching things like keyboard
interrupts.
|
|
A wart of the warning control API (enable/disable_*_warnings()) is that
the current warning settings can't be queried. Querying warning settings
is useful in functions that want to temporarily enable/disable some
warning and then put things back to how they were.
kconfiglib.load_allconfig() ran into this, for example.
Make the internal warning control variables public (improve the naming
at the same time), and encourage just setting them directly. Keep the
old API for backwards compatibility.
Also remove _warn_redun_assign() and _warn_override(). They're trivial
and were called in a single place.
|
|
Hardcoding load_config() and write_(min_)config() to write any message
to stdout is awkward, because it means that the message can't be easily
reused when stdout is the wrong place to write it to (e.g. in
menuconfig/guiconfig). This gets extra bad now that there's also the "No
change to ..." message.
Modify load_config() and write_(min_)config() to return the message as a
string instead, and have them always return a message, instead of just
when 'filename' is None and verbose=True. This makes things flexible and
straightforward.
Use the new behavior in menuconfig.py and guiconfig.py. They now show
"No change to ..." when saving a file doesn't modify it.
Tools that want to write messages to stdout should now do
print(kconf.load_config()) / print(kconf.write_config()).
There's no clean way to preserve perfect backwards compatibility here,
but keep accepting the 'verbose' argument and print a deprecation
warning if a value is ever passed for it. That way, scripts will keep
running, though possibly with less output on stdout.
This changes the meaning of the load_config() return value as well,
though I suspect it was only ever used by the menuconfig/guiconfig
interfaces.
The new behavior applies for kconfiglib.VERSION >= (12, 0, 0).
|
|
Holds a (<major>, <minor>, <patch>) tuple, e.g. (12, 0, 0).
|
|
Sourcing a file with an absolute path and using rsource in it triggered
a relpath() between the absolute path and $srctree. Since e.g.
symlink/../bar/ = bar/ is not guaranteed for symlinks, this could lead
to the rsource'd file not being found if $srctree pointed to a symlink.
Switch to a simpler, more textual method for stripping $srctree from
glob results, which should be robust against symlink shenanigans. This
also makes the code a bit easier to follow.
Discovered by Marc Herbert.
Piggyback some minor cleanup.
|
|
Remove some 'Note:'s, update some stuff.
|
|
Before writing a configuration file or header file, compare the old
contents of the file against the new contents. If there's no change,
skip the write, to avoid updating the file modification time.
This might avoid triggering redundant rebuilds depending on how the
build system is set up, and could allow for a simpler setup.
|
|
Gives a better overview.
|
|
Gives *nix rename() semantics on Windows, with overwriting of the target
file.
Also limit the scope of the catch-all try-except.
|
|
|
|
Mirrors commit aff11cd983ec ("kconfig: Terminate menu blocks with a
comment in the generated config") in the kernel.
This makes the compatibility tests pass again, and is handy.
|
|
Flatten, and unscrunch the bool/tristate case.
|
|
Consistent with the other ones.
|
|
Not just for syntax errors when raised from Kconfig.__init__().
|
|
|
|
|
|
Pro: Looks cleaner and matches how definitions are usually written.
Con: Makes it harder to discover that 'bool "foo"' is just shorthand for
'bool' + 'prompt "foo"' (though it's documented).
The pros probably win.
|
|
These are constant symbols, which is why the quotes showed up.
Special-case them to remove the quotes, to match what people expect.
Internally, n/m/y without quotes is taken as a shorthand for
"n"/"m"/"y".
|
|
Commit e81a77b ("Consistently put direct deps. last when propagating")
makes the position of the direct deps. in property conditions
predictable after dependency propagation, making it easy to strip them
as needed.
Use this to implement MenuNode.orig_{prompt,defaults,selects,implies,ranges},
which work like the non-orig_* versions but omit the direct deps. Use
those in turn to omit the direct deps in Symbol/Choice.__str__().
The direct deps. (with propagated parent deps.) can still be seen after
'depends on ...', so there is no loss of information.
This unclutters Kconfig definitions shown in menuconfig/guiconfig and in
any generated documentation. The old output also had duplicated
dependencies, though it doesn't matter for evaluation.
Before:
config A
bool
prompt "A" if DEP
default y if FOO && DEP
depends on DEP
After:
config A
bool
prompt "A"
default y if FOO
depends on DEP
|
|
Preparation for some later additions. Previously, the 'visible if' deps
appeared to the right of the 'depends on' deps. Now, the direct deps
always appear last.
With this change, the prompt tuple is only updated once for any given
menu node too, which should be a tiny bit faster.
|
|
KconfigSyntaxError is just an older (bad) name. pydoc generates
confusing documentation due to the "KconfigSyntaxError = KconfigError"
assignment, so mention it in the docstring.
|
|
Clearer.
|
|
|
|
- Mention that having no direct dependencies corresponds to having y
direct dependencies
- Remove the note about how direct_dep is used internally. It's also
used for the select-with-unsatisfied-deps warning.
- Remove the note about how checking direct_dep might be "redundant"
since it's propagated. direct_dep can be useful in scripts still, and
maybe it could scare people away from it.
- Say 'surrounding menus and ifs' instead of of 'parent' in the 'dep'
docstring
- Fix two s/config/kconfig/ typos
|
|
- Point out why dependencies from surrounding if's and menus are
included
- Clarify that .referenced isn't transitive. Only "direct" references
are included.
- Give a hint about direct dependencies and expr_items()
Prompted by https://github.com/ulfalizer/Kconfiglib/issues/69.
|
|
It's undocumented and unguessable that Kconfig.top_node.filename/linenr
gets set to the location of the 'mainmenu' statement (if any).
Always set it to the first line of the top-level Kconfig instead, which
should be more expected.
|
|
This is a graphical configuration interface written in Tkinter. Like
menuconfig.py, it supports showing all symbols (with invisible symbols
in red) and jumping directly to symbols. Symbol values can also be
changed directly from the jump-to dialog.
When single-menu mode is enabled, a single menu is shown at a time, like
in the terminal menuconfig. Only this mode distinguishes between symbols
defined with 'config' and symbols defined with 'menuconfig'.
Compatible with both Python 2 and Python 3. Has been tested on X11,
Windows, and macOS.
To avoid having to carry around a bunch of GIFs, the image data is
embedded in guiconfig.py. To use separate GIF files instead, change
_USE_EMBEDDED_IMAGES to False. The image files can be found in
https://github.com/ulfalizer/Kconfiglib/tree/screenshots/guiconfig.
A new `make guiconfig` target in the Makefile patch will run the GUI
configuration interface on the Linux kernel.
|
|
In retrospect, trying to be "helpful" by saving the old version of a
$KCONFIG_CONFIG that does not start with a '.' as e.g. '.config.old'
instead of 'config.old' is a bad idea, because it means that scripts
can't rely on the backup file simply being called $KCONFIG_CONFIG.old.
I spotted this causing compatibility issues in
https://github.com/automate-lfs/jhalfs/commit/a645174fd43ba4eee84089965df85785878e7aa6.
I had Vim backup files and the like in mind originally, but .config.old
is much more likely to be processed by scripts.
This is a small backwards compatibility break, so the major version will
be increased to 11.
|
|
Temporarily changing the working directory is iffy if threads are
involved, since other code will see the change. Seems like a generally
rude thing for a random library function to do.
dir_fd (open() relative to directory) is another option, but it's Python
3 only, only available on the low-level os.open() interface, and might
not be universally supported.
|
|
Says the same thing the comment above it says.
|
|
These are clear in context without the module name, and it speeds up the
'source' code a tiny bit.
|
|
|
|
Print a warning suggesting to add quotes for things like
source foo/bar/Kconfig
menu title
prompt unquoted
Example warning:
Kconfig:32: warning: style: quotes recommended around 'lib/Kconfig.debug' in 'source lib/Kconfig.debug'
That quoteless syntax is supported for compatibility with old versions
of the C tools. It only works for a single word.
|
|
|
|
Make kconfiglib.py consistent with the utilities.
|