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]> --- tools/qconfig.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.54.0

