Refactor MarkInstall fixing various or-group handling issues

In deb:#953875 we have a Recommends or-group "A | B" in which A has unsatisfiable dependencies: as apt is figuring this out far too late the or-group will not be satisfied at all. The same is true for Depends expect that the pkgProblemResolver will eventually take care of it, but relying on the problem resolver for this seems sub-optimal and letting it deal with Recommends is out of question.

Other things are always preferring to upgrade a member rather than install a new one (which might be exclusive causing a provider change for no reason) or delaying irreversible changes (e.g. autobit transfer). The changes have also slight benefits for ShowBroken output in testing, but that needs some love regardless. There are other changes possible to improve MarkInstall further, but that seems like a good step forward.

MarkInstall is a rather central piece of our resolver, so changing it is always dangerous and these changes are mostly for edge-cases and (usually) do not effect the solution, only how we reach it (at least for Depends where or-groups are far more common than in Recommends).

We are of course still a greedy algorithm, we are just trying to avoid making decisions too early or which make no sense. Bad things still happen if different subtrees conflict with each other, but that is the job the pkgProblemResolver is made for.

I haven't noticed any real performance changes for better or worse.

Tests/reviews welcome!

Merge request reports

Loading