Fix #89: Meaningful error message for missing arch in APKBUILD

The following message will be printed out now, in case you attempt
to build a package for an architecture, that is not specified in
the "arch=..." line inside the APKBUILD:

ERROR: Architecture 'aarch64' is not supported for this package.
Please add it to the 'arch=' line inside the APKBUILD and try again:
/path/to/APKBUILD
This commit is contained in:
Oliver Smith 2017-06-15 02:44:43 +02:00
parent 1adeee70b6
commit a9e28c9b8b
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,12 @@ def carch(args, apkbuild, carch):
if "noarch" in apkbuild["arch"]:
return args.arch_native
if carch:
if "all" not in apkbuild["arch"] and carch not in apkbuild["arch"]:
raise RuntimeError("Architecture '" + carch + "' is not supported"
" for this package. Please add it to the"
" 'arch=' line inside the APKBUILD and try"
" again: " + args.aports + "/" +
apkbuild["pkgname"] + "/APKBUILD")
return carch
if ("all" in apkbuild["arch"] or
args.arch_native in apkbuild["arch"]):