pmb.parse.kconfig: don't enforce non-core checks for testing devices
Currently when any device does not conform to the options they declare, we fail the whole kconfig check. Now that we start requiring more options, especially with pmb:kconfigcheck-community it makes sense to relax these restrictions so we're more free to edit kconfig options and don't have to adjust all testing devices that may or may not be properly maintained. As a side effect this patch makes it practically impossible to make kconfig check actually fail for any testing device which might not be optimal. If these use cases appear in the future we will want to adjust pmbootstrap to allow for that. Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221105074432.13804-2-luca@z3ntu.xyz%3E
This commit is contained in:
parent
381a1ca907
commit
4a6c5657d5
|
@ -93,7 +93,8 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
|||
netboot=False,
|
||||
community=False,
|
||||
uefi=False,
|
||||
details=False):
|
||||
details=False,
|
||||
enforce_check=True):
|
||||
logging.debug(f"Check kconfig: {config_path}")
|
||||
with open(config_path) as handle:
|
||||
config = handle.read()
|
||||
|
@ -126,10 +127,16 @@ def check_config(config_path, config_path_pretty, config_arch, pkgver,
|
|||
if uefi:
|
||||
components["uefi"] = pmb.config.necessary_kconfig_options_uefi
|
||||
|
||||
results = [check_config_options_set(config, config_path_pretty,
|
||||
config_arch, options, component,
|
||||
pkgver, details)
|
||||
for component, options in components.items()]
|
||||
results = []
|
||||
for component, options in components.items():
|
||||
result = check_config_options_set(config, config_path_pretty,
|
||||
config_arch, options, component,
|
||||
pkgver, details)
|
||||
# We always enforce "postmarketOS" component and when explicitly
|
||||
# requested
|
||||
if enforce_check or component == "postmarketOS":
|
||||
results += [result]
|
||||
|
||||
return all(results)
|
||||
|
||||
|
||||
|
@ -197,6 +204,10 @@ def check(args, pkgname,
|
|||
return None
|
||||
apkbuild = pmb.parse.apkbuild(f"{aport}/APKBUILD")
|
||||
pkgver = apkbuild["pkgver"]
|
||||
|
||||
# We only enforce optional checks for community & main devices
|
||||
enforce_check = aport.split("/")[-2] in ["community", "main"]
|
||||
|
||||
check_waydroid = force_waydroid_check or (
|
||||
"pmb:kconfigcheck-waydroid" in apkbuild["options"])
|
||||
check_iwd = force_iwd_check or (
|
||||
|
@ -239,7 +250,8 @@ def check(args, pkgname,
|
|||
netboot=check_netboot,
|
||||
community=check_community,
|
||||
uefi=check_uefi,
|
||||
details=details)
|
||||
details=details,
|
||||
enforce_check=enforce_check)
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue