summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-06-15Make 12.5.0 releasev12.5.0Ulf Magnusson
Adds commit 0c79d23 ("menuconfig: Be silent when changing LC_CTYPE to a UTF-8 locale").
2019-06-15menuconfig: Be silent when changing LC_CTYPE to a UTF-8 localeUlf Magnusson
Having LC_ALL=C and the like in Makefiles is probably pretty common, to get consistent collation and messages from commands and stuff. It currently makes menuconfig.py spit out a warning about changing the locale to a UTF-8 locale though. Just remove the message, and silently change the locale. The Python 3.7 PEP 538 code is silent as well.
2019-06-15Move .close() to a better spot in _leave_file()Ulf Magnusson
2019-06-13Hint towards sym.config_string where _write_to_conf is usedUlf Magnusson
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.
2019-06-11Add Python 3.8 trove classifierUlf Magnusson
Tested, works fine.
2019-06-09Replace os.environ.get() with os.getenv()Ulf Magnusson
Same behavior, simpler.
2019-06-09Make 12.4.0 releasev12.4.0Ulf Magnusson
Adds a small error message improvement, in commit 49831dd ("Give the 'source ...' line being parsed when a file can't be opened").
2019-06-09Move macro-related $ later in regexesUlf Magnusson
Bit cleaner-looking.
2019-06-09Give the 'source ...' line being parsed when a file can't be openedUlf Magnusson
Helpful when env. variables are involved. Previously only shown when the file couldn't be found.
2019-06-09Move self._line setting into _tokenize()Ulf Magnusson
Factors out some common code.
2019-06-09Get test coverage for --help---- and the likeUlf Magnusson
Weirdly formatted _T_HELP tokens are supported for compatibility with old versions of the C tools. Also add a lone '#' after the tricky help text. Some reconsidered refactoring choked on that.
2019-06-09menuconfig/guiconfig: Clean up 'range' checking a bitUlf Magnusson
Just cosmetic.
2019-06-07genconfig: Code ordering nitUlf Magnusson
Match the order the flags are defined.
2019-06-07Make 12.3.0 releasev12.3.0Ulf Magnusson
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")
2019-06-07genconfig: Support generating lists of files and environment vars.Ulf Magnusson
This can be useful to avoid needless reconfiguration, by checking if any Kconfig file or environment variable has changed value before running genconfig.
2019-06-07dumpvars: Make the output format copy-pasteableUlf Magnusson
Have it write assignments on a single line that can be copy-pasted before a command.
2019-06-06Make 12.2.1 releasev12.2.1Ulf Magnusson
Adds commit 443e6bb ("menuconfig: Fix help display on Python 2").
2019-06-06menuconfig: Fix help display on Python 2Ulf Magnusson
textwrap.indent() was added in Python 3.3.
2019-06-06Move Linux kernel installation instructions before Python compat. sectionUlf Magnusson
2019-06-06Make 12.2.0 releasev12.2.0Ulf Magnusson
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")
2019-06-06Update sample session in READMEUlf Magnusson
Make it reflect various output improvements added since it was written (e.g. 'depends on' not being shown on each property).
2019-06-06Add a section on version compatibility to the READMEUlf Magnusson
2019-06-06Tweak python_requires to 2.7/3.2+Ulf Magnusson
Many of the utilities need argparse, which was added in 3.2. Kconfiglib itself is compatible with 3.1.
2019-06-06Update setup.py now that menuconfig is Python 2-compatibleUlf Magnusson
Remove the Python 3 installation prereq for windows-curses, and another comment saying the menuconfig is Python 3 only.
2019-06-06Update various comments now that menuconfig is Python 2-compatibleUlf Magnusson
2019-06-06Remove Python 3 menuconfig special-casing from Makefile patchUlf Magnusson
Since it's now compatible with Python 2, it can use PYTHONCMD like the other targets.
2019-06-06menuconfig: Have hashbang point to 'python' instead of 'python3'Ulf Magnusson
Consistent with the other utilities, and now works even when 'python' is Python 2.
2019-06-06menuconfig: Import print_function for Python 2 compatibilityUlf Magnusson
2019-06-06menuconfig: Only decode curses.erasechar() on Python 3Ulf Magnusson
Avoids turning it into a Unicode string on Python 2, which gets messy when strings are compared.
2019-06-06menuconfig: Fall back on getch() when get_wch() isn't availableUlf Magnusson
Preparation for Python 2 compatibility. Also indirectly makes it compatible with Python 3.2 and earlier (get_wch() was added in 3.3).
2019-06-06menuconfig: Get rid of 'nonlocal'Ulf Magnusson
Preparation for Python 2 compatibility.
2019-06-04Make 12.1.0 releasev12.1.0Ulf Magnusson
Adds commit 22f2778 ("Mention that the load_config() message is different for replace=False")
2019-06-04Mention that the load_config() message is different for replace=FalseUlf Magnusson
Handy to know when writing merging utilities.
2019-06-04Remove reference to Kconfiglib 1 APIUlf Magnusson
2019-06-03Get rid of bare 'except:' in _save_old()Ulf Magnusson
Catch Exception instead, which avoids catching things like keyboard interrupts.
2019-06-03Make 12.0.0 releasev12.0.0Ulf Magnusson
Fixes two API issues. Some backwards compatibility breakage was required for the load_config()/write_config() message change, though the only effect on most scripts will be less output on stdout unless/until they're modified. - Commit bf36f5d ("Improve warning control API (with backwards compatibility)") - Commit 55bc8c3 ("Have load_config() and write_(min_)config() return messages") Kconfiglib now also makes the version number available: - Commit 455e366 ("Add kconfiglib.VERSION") These are longstanding issues. I don't know of any other ones that would warrant breaking backwards compatibility. Not going on some API changing spree.
2019-06-03Improve warning control API (with backwards compatibility)Ulf Magnusson
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.
2019-06-03Have load_config() and write_(min_)config() return messagesUlf Magnusson
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).
2019-06-03Add kconfiglib.VERSIONUlf Magnusson
Holds a (<major>, <minor>, <patch>) tuple, e.g. (12, 0, 0).
2019-06-01Make 11.9.1 releasev11.9.1Ulf Magnusson
Fixes an obscure rsource crash, in commit 92791a3 ("Fix obscure crash with rsource and $srctree pointing to a symlink").
2019-06-01Fix obscure crash with rsource and $srctree pointing to a symlinkUlf Magnusson
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.
2019-05-31Make 11.9.0 releasev11.9.0Ulf Magnusson
Adds commit 175c1f5 ("Leave unchanged output files untouched"). This avoids updating file modification timestamps when nothing has changed, which can make it easier to avoid triggering redundant rebuilds.
2019-05-31Comment nitsUlf Magnusson
Remove some 'Note:'s, update some stuff.
2019-05-31Leave unchanged output files untouchedUlf Magnusson
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.
2019-05-29Make 11.8.0 releasev11.8.0Ulf Magnusson
Adds commit 437c6cc ("Use os.replace() if available in _save_old()"), which gives rename() semantics on Windows, avoiding copying the file. This was cherry-picked out of a larger change re. avoiding touching files whose contents haven't changed. Will come later.
2019-05-29Split out helper for writing symbols in write_config()Ulf Magnusson
Gives a better overview.
2019-05-29Use os.replace() if available in _save_old()Ulf Magnusson
Gives *nix rename() semantics on Windows, with overwriting of the target file. Also limit the scope of the catch-all try-except.
2019-05-29Convert docstrings to comments in testsuite.pyUlf Magnusson
Like was done a long time ago in kconfiglib.py. These functions are not part of a standalone API. Keep the docstrings for the compatibility tests, because those get printed as the tests run.
2019-05-28Make 11.7.0 releasev11.7.0Ulf Magnusson
Adds commit 3aea9f7 ("Add '# end of <menu>' after menus in .config"), which mirrors a change in the C tools. The compatibility tests now pass again for the latest kernel.
2019-05-28Explain why node_iter() is not a good fit for write_config()Ulf Magnusson