Skip to content

Commit

Permalink
Make sure non-depsolvable units are passed around the depsolver
Browse files Browse the repository at this point in the history
Units like Errata aren't depsolved for so they won't come out the other
end of the depsolver. Need to re-combine the content sets afterwards to
make sure they get copied.

[noissue]
  • Loading branch information
dralley committed Mar 10, 2020
1 parent e5644a1 commit 5222a83
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pulp_rpm/app/depsolving.py
Expand Up @@ -774,10 +774,16 @@ def resolve_dependencies(self, unit_repo_map):
assert self._finalized, "Depsolver must be finalized before it can be used"

solvables = []
# units (like advisories) that aren't solved for in the dependency solver need to be
# passed through to the end somehow, so let's add them to a second mapping that mirrors
# the first and combine them again at the end.
passthrough = {k: set() for k in unit_repo_map.keys()}
for repo, units in unit_repo_map.items():
for unit in units:
if unit.pulp_type in {"rpm.package"}:
solvables.append(self.mapping.get_solvable(unit.pk, repo))
else:
passthrough[repo].add(unit.pk)

result_solvables = set()
self._pool.createwhatprovides()
Expand Down Expand Up @@ -842,4 +848,8 @@ def run_solver_jobs(jobs):
solvables_copied = run_solver_jobs(install_jobs)
result_solvables.update(solvables_copied)

return self.mapping.get_units_from_solvables(result_solvables)
solved_units = self.mapping.get_units_from_solvables(result_solvables)
for k in unit_repo_map.keys():
solved_units[k] |= passthrough[k]

return solved_units

0 comments on commit 5222a83

Please sign in to comment.