mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 11:29:46 +03:00
kconfig check: add --no-details argument
Provide a fast way to go through the no-details mode for kconfig check, which is otherwise only triggered after running "kconfig edit". This is useful for development. Reviewed-by: Clayton Craft <clayton@craftyguy.net> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-9-ollieparanoid@postmarketos.org%3E
This commit is contained in:
parent
9bbb1c11fc
commit
dffb8614bc
2 changed files with 7 additions and 2 deletions
|
@ -377,6 +377,7 @@ def newapkbuild(args):
|
||||||
|
|
||||||
def kconfig(args):
|
def kconfig(args):
|
||||||
if args.action_kconfig == "check":
|
if args.action_kconfig == "check":
|
||||||
|
details = args.kconfig_check_details
|
||||||
# Build the components list from cli arguments (--waydroid etc.)
|
# Build the components list from cli arguments (--waydroid etc.)
|
||||||
components_list = []
|
components_list = []
|
||||||
for name in pmb.parse.kconfig.get_all_component_names():
|
for name in pmb.parse.kconfig.get_all_component_names():
|
||||||
|
@ -386,7 +387,7 @@ def kconfig(args):
|
||||||
# Handle passing a file directly
|
# Handle passing a file directly
|
||||||
if args.file:
|
if args.file:
|
||||||
if pmb.parse.kconfig.check_file(args.package, components_list,
|
if pmb.parse.kconfig.check_file(args.package, components_list,
|
||||||
details=True):
|
details=details):
|
||||||
logging.info("kconfig check succeeded!")
|
logging.info("kconfig check succeeded!")
|
||||||
return
|
return
|
||||||
raise RuntimeError("kconfig check failed!")
|
raise RuntimeError("kconfig check failed!")
|
||||||
|
@ -414,7 +415,7 @@ def kconfig(args):
|
||||||
skipped += 1
|
skipped += 1
|
||||||
continue
|
continue
|
||||||
if not pmb.parse.kconfig.check(args, package, components_list,
|
if not pmb.parse.kconfig.check(args, package, components_list,
|
||||||
details=True):
|
details=details):
|
||||||
error = True
|
error = True
|
||||||
|
|
||||||
# At least one failure
|
# At least one failure
|
||||||
|
|
|
@ -464,6 +464,10 @@ def arguments_kconfig(subparser):
|
||||||
check.add_argument("--arch", choices=arch_choices, dest="arch")
|
check.add_argument("--arch", choices=arch_choices, dest="arch")
|
||||||
check.add_argument("--file", action="store_true", help="check a file"
|
check.add_argument("--file", action="store_true", help="check a file"
|
||||||
" directly instead of a config in a package")
|
" directly instead of a config in a package")
|
||||||
|
check.add_argument("--no-details", action="store_false",
|
||||||
|
dest="kconfig_check_details",
|
||||||
|
help="print one generic error per component instead of"
|
||||||
|
" listing each option that needs to be adjusted")
|
||||||
for name in pmb.parse.kconfig.get_all_component_names():
|
for name in pmb.parse.kconfig.get_all_component_names():
|
||||||
check.add_argument(f"--{name}", action="store_true",
|
check.add_argument(f"--{name}", action="store_true",
|
||||||
dest=f"kconfig_check_{name}",
|
dest=f"kconfig_check_{name}",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue