summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Stephan <[email protected]>2026-07-02 16:04:41 +0200
committerTom Rini <[email protected]>2026-07-14 15:41:23 -0600
commite24624017f49dfe22845316ccd11b8c4487c2022 (patch)
tree88a39e09147cfd73de26570c2016d4b3bc29c109
parente800cc67f5b6cb50a20f37c993ec1cd4063bdbd3 (diff)
tools: qconfig: print a proper error when database is missing
When CONFIG_DATABASE does not exist, read_database() would fail with a Python traceback. Add a pre-check to print a clear message asking the user to generate the database first with the -b option. Signed-off-by: Julien Stephan <[email protected]> Reviewed-by: Tom Rini <[email protected]>
-rwxr-xr-xtools/qconfig.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/qconfig.py b/tools/qconfig.py
index 5b85f9d22c3..9b151566e03 100755
--- a/tools/qconfig.py
+++ b/tools/qconfig.py
@@ -871,6 +871,10 @@ def read_database():
value: set of boards using that option
"""
+ if not os.path.exists(CONFIG_DATABASE):
+ sys.exit(f"Error: database '{CONFIG_DATABASE}' not found. "
+ f"Did you forget to generate it first with the -b option?")
+
configs = {}
# key is defconfig name, value is dict of (CONFIG_xxx, value)