pmb.parse.depends: ignore conflict dependency that no longer exists (MR 2181)

So it looks like some packages might be mentioned in the "depends=" of
other packages and marked as conflict, for example:
    depends="!foo"

..and the conflicting package can be dropped from the repo entirely if
it is no longer needed, however the reference to it in `depends=` still
exists. This handles that situation by just ignoring the missing package
if it is only a conflicting dependency.

fixes https://gitlab.com/postmarketOS/pmaports/-/issues/1525
This commit is contained in:
Clayton Craft 2022-05-12 22:25:21 -07:00
parent 6fbe916e0d
commit 9901cb31ea
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
2 changed files with 10 additions and 2 deletions

View File

@ -144,6 +144,11 @@ def recurse(args, pkgnames, suffix="native"):
# Nothing found
if not package:
if is_conflict:
# This package was probably dropped from the repos, so we don't
# care if it doesn't exist since it's a conflicting depend that
# wouldn't be installed anyways.
continue
source = 'world'
if pkgname_depend in required_by:
source = ', '.join(required_by[pkgname_depend])

View File

@ -146,13 +146,16 @@ def test_recurse(args, monkeypatch):
depends = {
"test": ["libtest", "so:libtest.so.1"],
"libtest": ["libtest_depend"],
"libtest_depend": ["!libtest_conflict"],
"libtest_depend": ["!libtest_conflict", "!libtest_conflict_missing"],
"libtest_conflict": [],
"so:libtest.so.1": ["libtest_depend"],
}
def package_from_index(args, pkgname, install, aport, suffix):
return {"pkgname": pkgname, "depends": depends[pkgname]}
if pkgname in depends:
return {"pkgname": pkgname, "depends": depends[pkgname]}
else:
return None
monkeypatch.setattr(pmb.parse.depends, "package_from_index",
package_from_index)