From f393bbdab1ef42c992a7861a80fef4f769c7b915 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 12 Mar 2023 16:13:16 +0100 Subject: [PATCH] kconfig check: less errors for non-detailed mode Don't print more than one non-detailed error per component, as it results in the same message. Adjust the description of the details parameter to reflect this. Reviewed-by: Clayton Craft Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-10-ollieparanoid@postmarketos.org%3E --- pmb/parse/kconfig.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pmb/parse/kconfig.py b/pmb/parse/kconfig.py index e75b6817..75fc402d 100644 --- a/pmb/parse/kconfig.py +++ b/pmb/parse/kconfig.py @@ -79,7 +79,7 @@ def check_option(component, details, config, config_path, option, Check, whether one kernel config option has a given value. :param component: name of the component to test (postmarketOS, waydroid, …) - :param details: print all warnings if True, otherwise one generic warning + :param details: print all warnings if True, otherwise one per component :param config: full kernel config as string :param config_path: full path to kernel config file :param option: name of the option to check, e.g. EXT4_FS @@ -134,7 +134,7 @@ def check_config_options_set(config, config_path, config_arch, options, } :param component: name of the component to test (postmarketOS, waydroid, …) :param pkgver: kernel version - :param details: print all warnings if True, otherwise one generic warning + :param details: print all warnings if True, otherwise one per component :returns: True if the check passed, False otherwise """ ret = True @@ -162,8 +162,9 @@ def check_config_options_set(config, config_path, config_arch, options, if not check_option(component, details, config, config_path, option, option_value): ret = False + # Stop after one non-detailed error if not details: - break # do not give too much error messages + return False return ret @@ -176,7 +177,7 @@ def check_config(config_path, config_arch, pkgver, components_list=[], :param config_arch: architecture name (alpine format, e.g. aarch64, x86_64) :param pkgver: kernel version :param components_list: what to check for, e.g. ["waydroid", "iwd"] - :param details: print all warnings if True, otherwise one generic warning + :param details: print all warnings if True, otherwise one per component :param enforce_check: set to False to not fail kconfig check as long as everything in kconfig_options is set correctly, even if additional components are checked