forked from Mirror/pmbootstrap
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:
parent
b5b127756b
commit
e9ca68dc05
4 changed files with 26 additions and 10 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue