Story #2478
closedSupport more conservative dependency solving
100%
Description
Description¶
Given two repositories:
Repository A with packages:
Foo-1.0
Foo-2.0
Foo-3.0
Bar-1.0
Repository B with packages:
Foo-1.0
And assuming Bar-1.0 requires Foo >= 1.0.
As i understand it, if a user performs a unit copy of Bar-1.0 from Repository A into Repository B with dependency resolution turned on (recursive = true), currently it will copy all packages from Repository A into Repository B that satisfies all of Bar-1.0's dependencies. In this example that would mean Foo-2.0, and Foo-3.0 are both copied to Repository B despite the fact that all of Bar-1.0's dependencies are already met in Repository B.
I think (and i think users would agree), that this should behave more like a 'yum install Foo-1.0' or a 'yum update Foo-1.0', in that it should only pull in dependencies that are actually needed by a client to install Bar-1.0 if they are not already in the target repository. So in this example the unit copy would only pull in Bar-1.0 and no additional dependencies.
Implementation¶
The PR https://github.com/pulp/pulp_rpm/pull/1122 implements the described behavior, having the libsolv
solver consider the target repository content.
An optional, future (Pulp3) behavior of actually upgrading the content in the target repository under the same circumstances i.e the opposite behavior, can be enforced by providing the solver a job constructed with the solv.Job.SOLVER_UPDATE
flag in addition to the current solv.Job.SOLVER_INSTALL
flag, possibly exposing this thru a REST API post request body field.
Related issues
Resolve rpm (rich) dependencies via libsolv
Pulp now uses libsolv as a dependency solver to address recursive RPM unit dependency solving during e.g unit copy
Fixes: #3715 https://pulp.plan.io/issues/3715
Fixes: #2478 https://pulp.plan.io/issues/2478