| |
@@ -2145,11 +2145,10 @@
|
| |
def run_on_applicable(self):
|
| |
|
| |
# pylint: disable=R0912
|
| |
- def resolve(requires_arg):
|
| |
+ def resolve_as_groups(requires_arg):
|
| |
"""
|
| |
Resolve list of symbols to packages in srpm or by repoquery
|
| |
"""
|
| |
- pkgs = []
|
| |
requires_to_process = list(requires_arg)
|
| |
for r in requires_arg:
|
| |
if r.startswith("rpmlib"):
|
| |
@@ -2162,27 +2161,21 @@
|
| |
if r in self.rpms.get(pkg).provides:
|
| |
requires_to_process.remove(r)
|
| |
break
|
| |
- if requires_to_process:
|
| |
- pkgs.extend(deps.resolve(requires_to_process))
|
| |
- pkgs = set(pkgs)
|
| |
- # Dirty workaround for pytest https://pagure.io/FedoraReview/issue/392
|
| |
- if "python3-pytest" in pkgs and "python3-pytest4" in pkgs:
|
| |
- pkgs.remove("python3-pytest4")
|
| |
- return pkgs
|
| |
+ return deps.resolve_as_groups(requires_to_process)
|
| |
|
| |
- pkg_deps = set()
|
| |
pkg_list = set()
|
| |
for pkg in self.spec.packages:
|
| |
- pkg_list |= set(self.rpms.get(pkg).requires)
|
| |
- pkg_list |= set(self.spec.build_requires)
|
| |
+ pkg_list |= set(self.rpms.get(pkg).requires_nevrs)
|
| |
+ pkg_list |= set(self.spec.build_requires_nevrs)
|
| |
|
| |
- pkg_deps |= resolve(pkg_list)
|
| |
-
|
| |
- for pkg in pkg_deps:
|
| |
- provides = deps.list_provides(pkg)
|
| |
- if any("deprecated()" in p for p in provides):
|
| |
+ for dependency, providers in resolve_as_groups(pkg_list).items():
|
| |
+ for pkg in providers:
|
| |
+ provides = deps.list_provides(pkg)
|
| |
+ if all("deprecated()" not in p for p in provides):
|
| |
+ break
|
| |
+ else:
|
| |
self.set_passed(
|
| |
- self.FAIL, pkg + " is deprecated, you must not depend on it."
|
| |
+ self.FAIL, dependency + " is deprecated, you must not depend on it."
|
| |
)
|
| |
return
|
| |
|
| |
Instead of putting all packages that satisfy all dependencies to one pile,
we group them by the dependency itself.
And we only report if all packages in one group are deprecated().
As a specific example consider python3-pytest4 is deprecated(),
and a package BuildRequires:
Previously, we would get:
{python3-devel, python3-pytest, python3-pytest4}
And one of the is deprecated() => false report
Now we get:
{python3-devel: [python3-devel], python3dist(pytest): [python3-pytest, python3-pytest4]}
And none of the groups is all-deprecated => no false report
Fixes https://pagure.io/FedoraReview/issue/392