repo_missing: don't check arch recursively (!1820)

Remove the recursive check, as it caused an infinite loop. It took a
very long time to complete anyway, even when it worked. The reasoning
for having the recursive check in the first place was, that we would
have device packages with arch=noarch set in the APKBUILD, but which
could only be built for a certain architecture (the device
architecture). Nowadays using arch=noarch in device packages is
forbidden, and we enforce that rule [1]. So the recursive arch check
isn't necessary anymore.

[1] ac6c0a2997
This commit is contained in:
Oliver Smith 2019-10-01 10:42:31 +02:00
parent 80a7fe8aaf
commit 925c56febe
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
4 changed files with 13 additions and 66 deletions

View file

@ -79,9 +79,9 @@ def test_filter_arch_packages(args, monkeypatch):
func = pmb.helpers.repo_missing.filter_arch_packages
check_arch = None
def stub(args, arch, pmaport):
def stub(args, arch, pmaport, binary=True):
return check_arch
monkeypatch.setattr(pmb.helpers.package, "check_arch_recurse", stub)
monkeypatch.setattr(pmb.helpers.package, "check_arch", stub)
check_arch = False
assert func(args, "armhf", ["hello-world"]) == []
@ -94,15 +94,15 @@ def test_get_relevant_packages(args, monkeypatch):
""" Test ...repo_missing.get_relevant_packages() """
# Set up fake return values
stub_data = {"check_arch_recurse": False,
stub_data = {"check_arch": False,
"depends_recurse": ["a", "b", "c", "d"],
"filter_arch_packages": ["a", "b", "c"],
"filter_aport_packages": ["b", "a"],
"filter_missing_packages": ["a"]}
def stub(args, arch, pmaport):
return stub_data["check_arch_recurse"]
monkeypatch.setattr(pmb.helpers.package, "check_arch_recurse", stub)
def stub(args, arch, pmaport, binary=True):
return stub_data["check_arch"]
monkeypatch.setattr(pmb.helpers.package, "check_arch", stub)
def stub(args, arch, pmaport):
return stub_data["depends_recurse"]
@ -133,7 +133,7 @@ def test_get_relevant_packages(args, monkeypatch):
assert "can't be built" in str(e.value)
# Package can be built for given arch
stub_data["check_arch_recurse"] = True
stub_data["check_arch"] = True
assert func(args, "armhf", "a") == ["a"]
assert func(args, "armhf", "a", True) == ["a", "b"]