| Age | Commit message (Collapse) | Author |
|
Stuff like this is not the pinnacle of helpful design, and hides that
the commands actually have long help texts (that can be viewed with
pydoc):
$ ./menuconfig.py --help
[Errno 2] No such file or directory: '--help'
Fix it by converting standard_kconfig() to argparse, and add a
'description' argument to it for the command-specific help text. --help
now shows the same help text shown by pydoc, and some other error
messages are improved as well.
Also fix some copy-paste errors and outdated paths in the help texts for
the all*config commands.
|
|
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).
|
|
Only appeared in two of the scripts, and main() is such a common
convention anyway.
|
|
Mention that the old version of an overwritten configuration file is
saved to <filename>.old in a few different places, to make it easier to
discover.
|
|
|
|
This makes running pydoc(3) on the utilities helpful.
Reuse the module docstring for the --help text for utilities that use
argparse.
Also fix some copy-paste errors in the all*config.py descriptions and
clean up the language a bit.
Piggyback removal of an optimization in allmodconfig.py that's pretty
irrelevant now.
|
|
|
|
Also remove some no longer used imports.
|
|
|
|
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.
|
|
Works like 'make olddefconfig', updating a configuration by filling in
default values for all new symbols.
This could also be accomplished by entering the 'menuconfig' interface
and saving the configuration, but it's more awkward and less obvious.
Piggyback two oldconfig changes:
- Mention KCONFIG_CONFIG
- Check if the .config file exists before parsing the Kconfig files,
instead of after
|
|
Some general cleanup:
- Handle the iteration with the new Kconfig.node_iter() helper.
This makes some function so short that they become pointless. Have
just main() + oldconfig(node) + small helper functions.
- Use _name_and_loc_str(sc) for choices too, so that all locations get
reported for named choices defined in multiple locations
- Rewrite the intro to be less wordy and remove the sample session
(leftover from when oldconfig.py was in examples/, and not that
exciting)
- Print "Updated configuration written to..." instead of
"Configuration saved to..."
- Various other nits
|
|
'?' should display the help, like for symbols, not '??'. Oversight when
the command was changed.
|
|
More common style.
|
|
Everything's ISC.
|
|
Removes repeated KCONFIG_CONFIG boilerplate.
Also make allyesconfig use KCONFIG_CONFIG when writing (oversight), and
document the sys.exit() behavior for standard_kconfig().
|
|
standard_kconfig() gets the top-level Kconfig file from the first
command-line argument, defaulting to "Kconfig". This removes some
boilerplate from tools.
|
|
All the packaged code will appear in the root.
|