forked from Mirror/pmbootstrap
kconfig check: remove redundant component lists
Components are the sets of kernel config options in pmb/config/__init__.py, such as the ones for waydroid, nftables, etc. Generate the list of components dynamically and refactor the code, so we can add/remove components in just one place. Reviewed-by: Clayton Craft <clayton@craftyguy.net> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-4-ollieparanoid@postmarketos.org%3E
This commit is contained in:
parent
d14dbd49de
commit
1a124ec2b6
5 changed files with 96 additions and 150 deletions
|
@ -377,16 +377,15 @@ def newapkbuild(args):
|
|||
|
||||
def kconfig(args):
|
||||
if args.action_kconfig == "check":
|
||||
# Build the components list from cli arguments (--waydroid etc.)
|
||||
components_list = []
|
||||
for name in pmb.parse.kconfig.get_all_component_names():
|
||||
if getattr(args, f"kconfig_check_{name}"):
|
||||
components_list += [name]
|
||||
|
||||
# Handle passing a file directly
|
||||
if args.file:
|
||||
if pmb.parse.kconfig.check_file(args.package,
|
||||
waydroid=args.waydroid,
|
||||
nftables=args.nftables,
|
||||
containers=args.containers,
|
||||
zram=args.zram,
|
||||
netboot=args.netboot,
|
||||
community=args.community,
|
||||
uefi=args.uefi,
|
||||
if pmb.parse.kconfig.check_file(args.package, components_list,
|
||||
details=True):
|
||||
logging.info("kconfig check succeeded!")
|
||||
return
|
||||
|
@ -414,17 +413,8 @@ def kconfig(args):
|
|||
if "!pmb:kconfigcheck" in apkbuild["options"]:
|
||||
skipped += 1
|
||||
continue
|
||||
if not pmb.parse.kconfig.check(
|
||||
args, package,
|
||||
force_waydroid_check=args.waydroid,
|
||||
force_iwd_check=args.iwd,
|
||||
force_nftables_check=args.nftables,
|
||||
force_containers_check=args.containers,
|
||||
force_zram_check=args.zram,
|
||||
force_netboot_check=args.netboot,
|
||||
force_community_check=args.community,
|
||||
force_uefi_check=args.uefi,
|
||||
details=True):
|
||||
if not pmb.parse.kconfig.check(args, package, components_list,
|
||||
details=True):
|
||||
error = True
|
||||
|
||||
# At least one failure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue