mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +03:00
kconfig check: add --keep-going argument (MR 2384)
Abort the "pmbootstrap kconfig check" on the first error, unless the --keep-going argument was passed. This makes it easier to go through the failed kernels one by one until they are all fixed.
This commit is contained in:
parent
816ae5ac6c
commit
f1afdeaaa1
4 changed files with 13 additions and 2 deletions
|
@ -77,7 +77,7 @@ def run_command(args: PmbArgs):
|
|||
elif args.action == "pull":
|
||||
command = Pull()
|
||||
elif args.action == "kconfig" and args.action_kconfig == "check":
|
||||
command = KConfigCheck(args.kconfig_check_details, args.file, args.package)
|
||||
command = KConfigCheck(args.kconfig_check_details, args.file, args.package, args.keep_going)
|
||||
elif args.action == "kconfig" and args.action_kconfig in ["edit", "migrate"]:
|
||||
command = KConfigEdit(args.package[0], args.action_kconfig == "migrate")
|
||||
else:
|
||||
|
|
|
@ -14,11 +14,13 @@ class KConfigCheck(commands.Command):
|
|||
details: bool
|
||||
file: str
|
||||
packages: list[str]
|
||||
keep_going: bool
|
||||
|
||||
def __init__(self, details, file, packages):
|
||||
def __init__(self, details, file, packages, keep_going):
|
||||
self.details = details
|
||||
self.file = file
|
||||
self.packages = packages
|
||||
self.keep_going = keep_going
|
||||
|
||||
def run(self):
|
||||
# Build the components list from cli arguments (--waydroid etc.)
|
||||
|
@ -51,6 +53,8 @@ class KConfigCheck(commands.Command):
|
|||
continue
|
||||
if not pmb.parse.kconfig.check(package, components_list, details=self.details):
|
||||
error = True
|
||||
if not self.keep_going:
|
||||
break
|
||||
|
||||
# At least one failure
|
||||
if error:
|
||||
|
|
|
@ -660,6 +660,12 @@ def arguments_kconfig(subparser):
|
|||
help="print one generic error per component instead of"
|
||||
" listing each option that needs to be adjusted",
|
||||
)
|
||||
check.add_argument(
|
||||
"-k",
|
||||
"--keep-going",
|
||||
action="store_true",
|
||||
help="continue on errors instead of aborting on the first error",
|
||||
)
|
||||
add_kernel_arg(check, nargs="*")
|
||||
|
||||
# "pmbootstrap kconfig edit"
|
||||
|
|
|
@ -99,6 +99,7 @@ class PmbArgs(Namespace):
|
|||
kconfig_check_details: bool
|
||||
kernel: str
|
||||
keymap: str
|
||||
keep_going: bool
|
||||
lines: int
|
||||
log: Path
|
||||
mirror_alpine: str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue