aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass2024-07-17 16:57:05 +0100
committerSimon Glass2024-07-26 08:01:06 -0600
commiteb1df3fde3f309e990c5cdb722dbcfbe8554468c (patch)
tree192e38450fb68faeea852ccf5c030a23134e38c6
parent630a9c9a4736fac39c858eb9bd220dd24b5e9bda (diff)
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>
-rwxr-xr-xtools/qconfig.py45
1 files changed, 25 insertions, 20 deletions
diff --git a/tools/qconfig.py b/tools/qconfig.py
index b1487928613..74d7d1bd175 100755
--- a/tools/qconfig.py
+++ b/tools/qconfig.py
@@ -693,18 +693,36 @@ class ReferenceSource:
return self.src_dir
-def move_config(toolchains, args, db_queue, col):
+def move_config(args, col):
"""Build database or sync config options to defconfig files.
Args:
- toolchains (Toolchains): Toolchains to use
args (Namespace): Program arguments
- db_queue (Queue): Queue for database updates
col (terminal.Color): Colour object
Returns:
- Progress: Progress indicator
+ tuple:
+ config_db (dict of configs for each defconfig):
+ key: defconfig name, e.g. "MPC8548CDS_legacy_defconfig"
+ value: dict:
+ key: CONFIG option
+ value: Value of option
+ Progress: Progress indicator
"""
+ config_db = {}
+ db_queue = queue.Queue()
+ dbt = DatabaseThread(config_db, db_queue)
+ dbt.daemon = True
+ dbt.start()
+
+ check_clean_directory()
+ bsettings.setup('')
+
+ # Get toolchains to use
+ toolchains = toolchain.Toolchains()
+ toolchains.GetSettings()
+ toolchains.Scan(verbose=False)
+
if args.git_ref:
reference_src = ReferenceSource(args.git_ref)
reference_src_dir = reference_src.get_dir()
@@ -733,7 +751,8 @@ def move_config(toolchains, args, db_queue, col):
time.sleep(SLEEP_TIME)
slots.write_failed_boards()
- return progress
+ db_queue.join()
+ return config_db, progress
def find_kconfig_rules(kconf, config, imply_config):
"""Check whether a config has a 'select' or 'imply' keyword
@@ -1590,23 +1609,9 @@ def main():
if args.find:
return do_find_config(args.configs)
- # We are either building the database or forcing a sync of defconfigs
- config_db = {}
- db_queue = queue.Queue()
- dbt = DatabaseThread(config_db, db_queue)
- dbt.daemon = True
- dbt.start()
-
- check_clean_directory()
- bsettings.setup('')
- toolchains = toolchain.Toolchains()
- toolchains.GetSettings()
- toolchains.Scan(verbose=False)
-
col = terminal.Color(terminal.COLOR_NEVER if args.nocolour
else terminal.COLOR_IF_TERMINAL)
- progress = move_config(toolchains, args, db_queue, col)
- db_queue.join()
+ config_db, progress = move_config(args, col)
configs = args.configs
if args.commit: