pmbootstrap kconfig edit: list all arches in error (MR 1957)

If a kernel is available for multiple architectures, let the user know
which architectures are available in the error message.
This commit is contained in:
Oliver Smith 2020-07-09 11:08:13 +02:00 committed by Luca Weiss
parent 9815f81742
commit a870a69151
No known key found for this signature in database
GPG key ID: 72D843B89D4DD756

View file

@ -28,9 +28,10 @@ def get_arch(args, apkbuild):
# Multiple architectures (requires --arch) # Multiple architectures (requires --arch)
if len(apkbuild["arch"]) > 1: if len(apkbuild["arch"]) > 1:
if args.arch is None: if args.arch is None:
raise RuntimeError("Package '" + pkgname + "' supports multiple" raise RuntimeError(f"'{pkgname}' supports multiple architectures"
" architectures, please use '--arch' to specify" f" ({', '.join(apkbuild['arch'])}). Please use"
" the desired architecture.") " '--arch' to specify the desired"
" architecture.")
return args.arch return args.arch
# Single architecture (--arch must be unset or match) # Single architecture (--arch must be unset or match)