Commit graph

33 commits

Author SHA1 Message Date
Simon Glass
0220a68c25 qconfig: Update tool for new Makefile variables
Take account of the new XPL_ and PHASE_ instead of the old SPL_ and
SPL_TPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
5c10c8badf global: Rename SPL_TPL_ to PHASE_
Use PHASE_ as the symbol to select a particular XPL build. This means
that SPL_TPL_ is no-longer set.

Update the comment in bootstage to refer to this symbol, instead of
SPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
c46760d596 global: Rename SPL_ to XPL_
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is
no-longer set.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
90fb55e042 qconfig: Add XPL_BUILD to ignored symbols
This now appears in the code base, so add it to the list of ignored
symbols in qconfig

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Simon Glass
4597acbd59 qconfig: Fix an incorrect format-string with negative value
This is not allowed, so use ljust() instead. This fixes the
'qconfig -i -I help' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 1bd43060b3 ("moveconfig: Use f strings where possible")
2024-09-01 11:05:43 -06:00
Simon Glass
00b0855aef qconfig: Support a 'list' format
Add a flag to output the found list in a more user-friendly format, with
one board per line. Omit the board count.

This can be useful with grep, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29 08:42:18 -06:00
Simon Glass
6bf44b48f9 qconfig: Sort the boards by name when finding
There is no particular ordering of the board list at present, since it
is generated by a multi-threaded process. Sort them by name to make it
easier to see if a particular board is present.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-29 08:42:18 -06:00
Simon Glass
7ff80ece21 qconfig: Allow searching for CONFIG values
Add basic support for searching for matching of non-matching values.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/20
2024-07-29 08:42:18 -06:00
Simon Glass
c57d406134 qconfig: Move operation check into parse_args()
Put the check for an operation being provided into the parse_args()
function, to reduce the size of main().

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
e23a583940 qconfig: Drop col argument from Slots()
This is not needed since the progress indicator has the object. Use that
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
948d0b45f5 qconfig: Use the Color object in Progress
Since the Progress class has the required object, use it from there
instead of passing it around.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
ab1bfd4b8f qconfig: Move the last two operations into their own functions
Put the summary and database-writing code into separate functions to
reduce the size of main().

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
0229eeef7b qconfig: Move progress output into the class
Rather than create these outputs separately, put them in the class so
that the main program doesn't need to deal with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
6c2a4385ff qconfig: Move commit code into a separate function
Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
eb1df3fde3 qconfig: Move all move_config code into move_config()
Move the setup and completion code into the move_config() function so
it is all in one place.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
630a9c9a47 qconfig: Add a return value to do_find_config()
Return an exit code so we can use this function like do_tests().
Refactor the caller to handle this.

Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
cc628f582a qconfig: Move imply into a separate function
Reduce the size of main() by putting this code into its own function,
with the usage message staying in main().

Tidy up the comments for do_imply_config() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
d63357eefc qconfig: Add a return value to do_scan_source()
Return an exit code so we can use this function like do_tests().
Refactor the caller to handle this.

Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
7e68804fa3 qconfig: Move testing into a separate function
Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
fd35fbe222 qconfig: Move converting config args to the top
Move this check to the top, so it happens always. There is no harm to
doing this earlier and it separates the setup from actual program logic.

Update the arg rather than adding a new variable, with the new variable
only created when moving or building, since it is used more heavily.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
c50b6f18f3 qconfig: Move checking directory to the top
Move this check to the top, so it happens always. The tool should be
run from the U-Boot source directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
035ecb44ec qconfig: Move getting the colour to where it is needed
Move this assignment down to just above where it is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
382c662c82 qconfig: Move arg checking to the top of main()
Check for 'test' as one of the possible operations for this tool,
moving the check above the implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
fd385b3b01 qconfig: Move arg checking a little higher
Check for scan_source as one of the possible operations for this tool,
moving the check above the scan_source implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
a056c4272c qconfig: Move arg parsing into a separate function
Reduce the size of main() by putting this code into its own function.
For now the parser object needs to be returned too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
495e58c920 qconfig: Rename the doc link
This was missed during the renaming of the tool. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: ea4d6dead3 ("moveconfig: Rename the tool to qconfig")
2024-07-26 08:01:06 -06:00
Simon Glass
0e03fb1848 qconfig: Correct format string in do_imply_config()
One of the strings was converted incorrectly. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 1bd43060b3 ("moveconfig: Use f strings where possible")
2024-07-26 08:01:06 -06:00
Simon Glass
f876e96f4c qconfig: Tidy up some pylint warnings
Reduce the number of warnings in this file a little bit.

Add my own name to the copyright message.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
0a0c124008 qconfig: Make KconfigScanner a function
This doesn't have any methods so is not good as a class. Make it a
function instead, to keep pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
deedf65306 qconfig: Drop the try_expand() function
This is not used anymore, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:06 -06:00
Simon Glass
61d555d8a7 qconfig: Fix pylint error in read_database()
Fix this error by initing the variable before the loop:

tools/qconfig.py:880:22: E0606: Possibly using variable 'defconfig'
   before assignment (possibly-used-before-assignment)

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-26 08:01:05 -06:00
Simon Glass
519637929b qconfig: Rename the database file
Use qconfig.db as the new name, to reflect the tool's purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-04 09:25:22 -06:00
Simon Glass
ea4d6dead3 moveconfig: Rename the tool to qconfig
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>
2023-10-04 09:25:21 -06:00
Renamed from tools/moveconfig.py (Browse further)