aboutsummaryrefslogtreecommitdiff
path: root/tools/moveconfig.py
Commit message (Collapse)AuthorAgeFilesLines
* moveconfig: Rename the tool to qconfigSimon Glass2023-10-041-1624/+0
| | | | | | | 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 <sjg@chromium.org>
* moveconfig: Move summaries to the endSimon Glass2023-10-041-13/+23
| | | | | | Write the summary for -s and -b at the end, using a unified format. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Drop the initial outputSimon Glass2023-10-041-6/+0
| | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Show a summary at the endSimon Glass2023-10-041-13/+15
| | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Show failures in progressSimon Glass2023-10-041-7/+19
| | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Use u_boot_pylib for terminal colourSimon Glass2023-10-041-54/+38
| | | | | | | 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 <sjg@chromium.org>
* moveconfig: Avoid showing progress at the endSimon Glass2023-10-041-1/+2
| | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Reduce the amount of outputSimon Glass2023-10-041-12/+17
| | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Only show output when there is a reasonSimon Glass2023-10-041-6/+6
| | | | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Fix misc pylint warningsSimon Glass2023-10-041-11/+12
| | | | | | Fix various remaining pylint warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Use an encoding with open()Simon Glass2023-10-041-2/+4
| | | | | | Fix pylint warnings about needing an explicit character encoding. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct list-comprehension warningsSimon Glass2023-10-041-4/+4
| | | | | | Correct some pylint warnings about needing to use list comprehension. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct use of members not declared in __init__()Simon Glass2023-10-041-0/+4
| | | | | | Fix these pylint warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct non-snake variables namesSimon Glass2023-10-041-35/+35
| | | | | | | Correct some variable names that do not conform to snake case, with the three-character minimum. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct unused variablesSimon Glass2023-10-041-14/+12
| | | | | | Fix pylint warnings about unused variables. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Use f strings where possibleSimon Glass2023-10-041-28/+28
| | | | | | Avoid pylint warnings by using 'f' strings where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct parameter-type warningsSimon Glass2023-10-041-21/+22
| | | | | | Fix pylint warnings related to parameter types. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct some regular-expression stringsSimon Glass2023-10-041-4/+4
| | | | | | Use the 'r' prefix for these strings to avoid pylint warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Drop suspicious boardsSimon Glass2023-10-041-25/+0
| | | | | | This code isn't needed anymore. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Drop check_defconfig() and update_dotconfig()Simon Glass2023-10-041-60/+2
| | | | | | These functions are not needed anymore. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Drop CONFIG-moving codeSimon Glass2023-10-041-144/+19
| | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Drop unused cleanup optionsSimon Glass2023-10-041-252/+2
| | | | | | | 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 <sjg@chromium.org>
* moveconfig: Correct ordering of asteval importSimon Glass2023-10-041-1/+1
| | | | | | | This should be after the standard imports. Move it to avoid a lot of pylint warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Avoid deprecation warning for setDaemonSimon Glass2023-10-041-1/+1
| | | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Drop -H optionSimon Glass2023-10-041-11/+7
| | | | | | | Drop this option, which is no longer needed now that we have converted all CONFIG options to Kconfig. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Convert camel case in bsettings.pySimon Glass2023-07-241-1/+1
| | | | | | Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Add an option to compare Kconfig against sourceSimon Glass2023-02-071-0/+334
| | | | | | | | | | 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 <sjg@chromium.org>
* kbuild: Remove checking for adhoc CONFIG symbolsTom Rini2022-12-231-30/+2
| | | | | | | | | | 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 <trini@konsulko.com>
* Revert "Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support""Simon Glass2022-08-051-65/+0
| | | | | | | | | | | 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 <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support"Tom Rini2022-04-021-0/+65
| | | | | | | | | 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 <trini@konsulko.com>
* global: Remove CONFIG_SYS_EXTRA_OPTIONS supportTom Rini2022-04-011-65/+0
| | | | | | | All options have now been migrated to Kconfig correctly so remove this support. Signed-off-by: Tom Rini <trini@konsulko.com>
* moveconfig: Use re.fullmatch() to avoid extra checkSimon Glass2022-03-181-2/+1
| | | | | | | Simplify the code by using the available function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
* moveconfig: Remove remove_defconfig()Simon Glass2022-03-181-12/+1
| | | | | | | | | This is not necessary if simpler code is used. Use the split function and drop the unnecessary [] Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
* moveconfig: Correct pylint errorsSimon Glass2022-03-021-4/+1
| | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Allow regex matches when finding combinationsSimon Glass2022-02-221-2/+22
| | | | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Show the config name rather than the defconfigSimon Glass2022-02-221-1/+14
| | | | | | | The _defconfig suffix is unnecessary when showing matching boards. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Fix code relying on now-stripped newline charactersAlper Nebi Yasak2022-01-301-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | 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 <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* moveconfig: Fix some pylint errorsSimon Glass2022-01-241-96/+110
| | | | | | | 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 <sjg@chromium.org>
* moveconfig: Use a function to read filesSimon Glass2022-01-241-50/+63
| | | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Use a function to write filesSimon Glass2022-01-241-18/+23
| | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Drop check for old PythonSimon Glass2022-01-241-9/+1
| | | | | | | | 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 <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* moveconfig: Convert to ArgumentParserSimon Glass2022-01-241-109/+112
| | | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Use single quotesSimon Glass2022-01-241-36/+36
| | | | | | | | Quite a few places use double quotes. Fix this to be consistent with other Python code in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* moveconfig: Allow querying board configurationSimon Glass2022-01-241-4/+82
| | | | | | | | | | | 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 <sjg@chromium.org>
* moveconfig: Allow adding unit testsSimon Glass2022-01-241-0/+9
| | | | | | Add a -t option to run unit tests in this program. So far, there is none. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Sort the optionsSimon Glass2022-01-241-10/+12
| | | | | | | Put the options in sorted order by their short name so it is easier to find an option. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Read the database in a separate functionSimon Glass2022-01-241-29/+49
| | | | | | Move this code out into a function so it can be used elsewhere. Signed-off-by: Simon Glass <sjg@chromium.org>
* moveconfig: Correct operation of the 'imply' featureSimon Glass2022-01-241-4/+5
| | | | | | | 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 <sjg@chromium.org>
* moveconfig: Update to newer kconfiglibSimon Glass2021-08-011-12/+12
| | | | | | | 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 <sjg@chromium.org>
* doc: Add docs for the moveconfig toolSimon Glass2021-08-011-290/+1
| | | | | | Move these docs into htmldocs so they can be read there. Signed-off-by: Simon Glass <sjg@chromium.org>