Skip to content

Commit

Permalink
Fix DISTRO_SYNC_ALL (distro-sync without arguments, system upgrade)
Browse files Browse the repository at this point in the history
Since distro-sync uses `SOLVER_TARGETED` mode we cannot pass in
installed packages because if we did updating only a subset of packages
would be a valid solution. However in a distro-sync we want to ensure
ALL packages are synchronized with the target repository.

This brings dnf5 behavior closer to dnf4.
There is still one difference in the transaction setup, dnf4 doesn't
specify the transaction as targeted but thanks to libsolv's
`auto-targeting` this should have the same behavior.

For: https://bugzilla.redhat.com/show_bug.cgi?id=2273749
  • Loading branch information
kontura committed Apr 9, 2024
1 parent 85dc3c3 commit 80479dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libdnf5/base/goal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,10 @@ GoalProblem Goal::Impl::add_specs_to_goal(base::Transaction & transaction) {
} break;
case GoalAction::DISTRO_SYNC_ALL: {
rpm::PackageQuery query(base);
// Since distro-sync uses SOLVER_TARGETED mode we cannot pass in installed packages because if we did
// updating only a subset of packages would be a valid solution. However in a distro-sync we want to
// ensure ALL packages are synchronized with the target repository.
query.filter_available();
libdnf5::solv::IdQueue upgrade_ids;
for (auto package_id : *query.p_impl) {
upgrade_ids.push_back(package_id);
Expand Down

0 comments on commit 80479dd

Please sign in to comment.