summaryrefslogtreecommitdiff
path: root/tools/moveconfig.py
AgeCommit message (Collapse)Author
2023-10-04moveconfig: Rename the tool to qconfigSimon Glass
This does not move configs anymore, but queries them, based on a database it can build. Rename the tool to better reflect its purpose. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Move summaries to the endSimon Glass
Write the summary for -s and -b at the end, using a unified format. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Drop the initial outputSimon Glass
Since moveconfig now just does what it is told (build database or sync defconfigs) we don't need to print what it is doing. Drop this info, which is of very little use. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Show a summary at the endSimon Glass
Rather than printing all the failed boards, which are now easily visible on the terminal, just show a summary. Sort it by defconfig and drop the '_defconfig' suffix. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Show failures in progressSimon Glass
Show the number of accumulated failures when processing. Use a shorter format with colour. An unwanted space appears before the defconfig name on every item except the last. Fix that while we are here. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Use u_boot_pylib for terminal colourSimon Glass
Use the existing terminal code to handle ANSI colours. Enable colour by default if the output is going to a terminal. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Avoid showing progress at the endSimon Glass
When the process is finished, moveconfig leaves a line saying that all boards were processed (for better or worse). Drop this, since it is unncessary. Future work will provide a summary at the end instead. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Reduce the amount of outputSimon Glass
Output a single line in the case where the defconfig only has one line of output. Show the name without the _defconfig suffix, since that is the same for all boards. Use a list for the log so it is easier to process at the end. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Only show output when there is a reasonSimon Glass
There is no point in listing a board if everything went well. It makes it harder to see the failures, particularly on a fast machine. Suppress output unless something actually happened. Drop the 'Syncing by savedefconfig' since this is selected by the -s and is the same for all boards in this mode. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Fix misc pylint warningsSimon Glass
Fix various remaining pylint warnings. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Use an encoding with open()Simon Glass
Fix pylint warnings about needing an explicit character encoding. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct list-comprehension warningsSimon Glass
Correct some pylint warnings about needing to use list comprehension. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct use of members not declared in __init__()Simon Glass
Fix these pylint warnings. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct non-snake variables namesSimon Glass
Correct some variable names that do not conform to snake case, with the three-character minimum. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct unused variablesSimon Glass
Fix pylint warnings about unused variables. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Use f strings where possibleSimon Glass
Avoid pylint warnings by using 'f' strings where possible. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct parameter-type warningsSimon Glass
Fix pylint warnings related to parameter types. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct some regular-expression stringsSimon Glass
Use the 'r' prefix for these strings to avoid pylint warnings. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Drop suspicious boardsSimon Glass
This code isn't needed anymore. Drop it. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Drop check_defconfig() and update_dotconfig()Simon Glass
These functions are not needed anymore. Drop them. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Drop CONFIG-moving codeSimon Glass
As a step towards cleaning out old code, drop most of the code that moves CONFIG options to Kconfig. This includes parse_one_config(). Drop the ACTION_... values as well, since they are no-longer used. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Drop unused cleanup optionsSimon Glass
Cleaning up the README and config.h files are not needed now, since we don't have any CONFIG options to convert. Drop this code. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Correct ordering of asteval importSimon Glass
This should be after the standard imports. Move it to avoid a lot of pylint warnings. Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Avoid deprecation warning for setDaemonSimon Glass
Use the recommended new way of setting a thread to be a daemon. This avoids a warning: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead Signed-off-by: Simon Glass <[email protected]>
2023-10-04moveconfig: Drop -H optionSimon Glass
Drop this option, which is no longer needed now that we have converted all CONFIG options to Kconfig. Signed-off-by: Simon Glass <[email protected]>
2023-07-24buildman: Convert camel case in bsettings.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <[email protected]>
2023-02-07moveconfig: Add an option to compare Kconfig against sourceSimon Glass
Sometimes the Makefile rules or source code refers to Kconfig options which don't exist. Update the moveconfig tool to check this and produce a series of reports about inconsistencies. This can then be used to generate patches to correct the problems. Signed-off-by: Simon Glass <[email protected]>
2022-12-23kbuild: Remove checking for adhoc CONFIG symbolsTom Rini
At this point all listed adhoc CONFIG symbols have been migrated to Kconfig or removed from the tree or renamed to CFG (or similar). We also now have CI tests that will error on any new introductions, and checkpatch.pl also looks. We can now remove these hooks and related scripts. Signed-off-by: Tom Rini <[email protected]>
2022-08-05Revert "Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support""Simon Glass
This is not needed now that CONFIG_SYS_TARGET_NAME is correctly determined when scanning Kconfig. This reverts commit 25b8acee2ea11a9edc100c42a61f5d6187eb6167. Signed-off-by: Simon Glass <[email protected]> Suggested-by: Tom Rini <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2022-04-02Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support"Tom Rini
Unfortunately, we require additional logic to buildman to support this removal and still use SYS_SOC, etc, for build targets. This reverts commit eeec00072d7a0b5b91896d014618e558ce438738. Signed-off-by: Tom Rini <[email protected]>
2022-04-01global: Remove CONFIG_SYS_EXTRA_OPTIONS supportTom Rini
All options have now been migrated to Kconfig correctly so remove this support. Signed-off-by: Tom Rini <[email protected]>
2022-03-18moveconfig: Use re.fullmatch() to avoid extra checkSimon Glass
Simplify the code by using the available function. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]>
2022-03-18moveconfig: Remove remove_defconfig()Simon Glass
This is not necessary if simpler code is used. Use the split function and drop the unnecessary [] Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]> Suggested-by: Alper Nebi Yasak <[email protected]>
2022-03-02moveconfig: Correct pylint errorsSimon Glass
Fix two pylint errors in this file. Note ACTION_SPL_NOT_EXIST is not defined so the dead code can be removed. Signed-off-by: Simon Glass <[email protected]>
2022-02-22moveconfig: Allow regex matches when finding combinationsSimon Glass
It is useful to be able to search for CONFIG options that match a regex, such as this, which lists boards which define SPL_FIT_GENERATOR and anything not starting with ROCKCHIP: ./tools/moveconfig.py -f SPL_FIT_GENERATOR ~ROCKCHIP.* Add support for this. Signed-off-by: Simon Glass <[email protected]>
2022-02-22moveconfig: Show the config name rather than the defconfigSimon Glass
The _defconfig suffix is unnecessary when showing matching boards. Drop it. Signed-off-by: Simon Glass <[email protected]>
2022-01-30moveconfig: Fix code relying on now-stripped newline charactersAlper Nebi Yasak
Commit 37f815cad07d ("moveconfig: Use a function to read files") adds a helper function that can read a file as lines, but strips the newline characters. This change broke parts of moveconfig code that relied on their existence, resulting in a few issues: Configs that are defined as empty aren't removed from header files (e.g. "#define CONFIG_REMAKE_ELF"). Make regex patterns use '\b' to match word boundaries instead of '\W' (which matched the newlines) so these lines still match and get removed. All changes in defconfig are considered removed by savedefconfig even if they weren't, and line continuations in the headers aren't recognized and removed properly, because their checks explicitly look for a newline character. Remove the character from both comparisons. The printed diff of header files is wrongly formatted and raises an IndexError if a blank line was removed. Let print() print the new lines, and use size-independent ways to check strings to fix the diff output. Signed-off-by: Alper Nebi Yasak <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Fix some pylint errorsSimon Glass
There are over 200 errors in this file. Fix some of them, starting at the beginning of the file. Future work can continue this effort. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Use a function to read filesSimon Glass
At present there is quite a bit of ad-hoc code reading from files. The most common case is to read the file as lines. Put it in a function and set the unicode encoding correctly. Avoid writing back to a file when there are obviously no changes as this speeds things up slightly. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Use a function to write filesSimon Glass
At present there is quite a bit of ad-hoc code writing to files. The treatment of newlines is different in some of them. Put it in a function and set the unicode encoding correctly. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Drop check for old PythonSimon Glass
Python 2 is not supported anymore and Python 3 has had subprocess.DEVNULL since version 3.3 which was released in 2012. Drop the unnecessary check. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-01-24moveconfig: Convert to ArgumentParserSimon Glass
This is a newer library and is now preferred for Python scripts. Update the code to use it instead of optparse Use 'args' instead of 'options' throughout, since this is the term used in that module. Also it helps to avoid confusion with CONFIG options, a term that is used in this file. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Use single quotesSimon Glass
Quite a few places use double quotes. Fix this to be consistent with other Python code in U-Boot. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-01-24moveconfig: Allow querying board configurationSimon Glass
It is useful to be able to find out which boards define a particular option, or combination of options. This is not as easy as grepping the defconfig files since many options are implied by others. Add a -f option to the moveconfig tool to permit this. Update the documentation to cover this, including a better title for the doc page. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Allow adding unit testsSimon Glass
Add a -t option to run unit tests in this program. So far, there is none. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Sort the optionsSimon Glass
Put the options in sorted order by their short name so it is easier to find an option. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Read the database in a separate functionSimon Glass
Move this code out into a function so it can be used elsewhere. Signed-off-by: Simon Glass <[email protected]>
2022-01-24moveconfig: Correct operation of the 'imply' featureSimon Glass
This doesn't work anymore, since the Kconfig update. The script has no tests so we did not notice. Fix it. Signed-off-by: Simon Glass <[email protected]>
2021-08-01moveconfig: Update to newer kconfiglibSimon Glass
Some of the more advanced features of this tool don't work anymore since kconfiglib was update. Update the code accordingly. Signed-off-by: Simon Glass <[email protected]>
2021-08-01doc: Add docs for the moveconfig toolSimon Glass
Move these docs into htmldocs so they can be read there. Signed-off-by: Simon Glass <[email protected]>