Skip to content

Commit

Permalink
Allow obsoletion of protected packages
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-goode committed Jul 17, 2023
1 parent ef374fd commit ddd2b54
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions libdnf5/rpm/solv/goal_private.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,20 +571,16 @@ libdnf5::GoalProblem GoalPrivate::protected_in_removals() {
return ret;
}
auto removes = list_removes();
auto obsoleted = list_obsoleted();
if (removes.empty() && obsoleted.empty()) {
if (removes.empty()) {
removal_of_protected.reset();
return ret;
}

auto & pool = get_rpm_pool();

libdnf5::solv::SolvMap pkg_remove_list(pool->nsolvables);
for (auto index = 0; index < removes.size(); ++index) {
pkg_remove_list.add_unsafe(removes[index]);
}
for (auto index = 0; index < obsoleted.size(); ++index) {
pkg_remove_list.add_unsafe(obsoleted[index]);
for (const auto & remove : removes) {
pkg_remove_list.add_unsafe(remove);
}

libdnf5::solv::SolvMap protected_pkgs(pool->nsolvables);
Expand Down

0 comments on commit ddd2b54

Please sign in to comment.