Fix #941: Use the right arch for foreign-arch-only packages (#943)

This is a follow-up to #935.

* fix regression #941: pmbootstrap doesn't automatically pick the
  right architecture for building when none is specified
* remove obsolete --noarch-arch parameter
This commit is contained in:
Oliver Smith 2017-11-28 19:12:16 +00:00 committed by GitHub
parent b5b127756b
commit e9ca68dc05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 10 deletions

View file

@ -22,6 +22,22 @@ import pmb.chroot.apk
import pmb.parse.arch
def arch(args, pkgname):
"""
Find a good default in case the user did not specify for which architecture
a package should be built.
:returns: native architecture (x86_64 in most cases) when the APKBUILD has
"noarch" or "all". Otherwise the first architecture in the
APKBUILD.
"""
aport = pmb.build.find_aport(args, pkgname)
apkbuild = pmb.parse.apkbuild(args, aport + "/APKBUILD")
if "noarch" in apkbuild["arch"] or "all" in apkbuild["arch"]:
return args.arch_native
return apkbuild["arch"][0]
def suffix(args, apkbuild, arch):
if arch == args.arch_native:
return "native"