pmb.helpers.package.check_arch(): split (!1776)

Split the part that actually checks the arch against the arches list
into pmb.helpers.pmaports.check_arches(arches, arch), and call it
from pmb.helpers.package.check_arch(args, pkgname, arch, binary).

This will be used in a follow up commit, where we have already resolved
the package data and only need to check the architecture.
This commit is contained in:
Oliver Smith 2019-04-20 01:20:16 +02:00
parent 9241dbb35b
commit 99e7ae3019
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 18 additions and 7 deletions

View file

@ -164,13 +164,7 @@ def check_arch(args, pkgname, arch, binary=True):
arches = get(args, pkgname, arch)["arch"]
else:
arches = pmb.helpers.pmaports.get(args, pkgname)["arch"]
if "!" + arch in arches:
return False
for value in [arch, "all", "noarch"]:
if value in arches:
return True
return False
return pmb.helpers.pmaports.check_arches(arches, arch)
def check_arch_recurse(args, pkgname, arch):