From ddd2b54435db084773915d9eca4bd2ced5d5de07 Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Mon, 17 Jul 2023 20:37:46 +0000 Subject: [PATCH] Allow obsoletion of protected packages See https://github.com/rpm-software-management/libdnf/pull/1610 --- libdnf5/rpm/solv/goal_private.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libdnf5/rpm/solv/goal_private.cpp b/libdnf5/rpm/solv/goal_private.cpp index 12cc29cc35..89da492ca8 100644 --- a/libdnf5/rpm/solv/goal_private.cpp +++ b/libdnf5/rpm/solv/goal_private.cpp @@ -571,8 +571,7 @@ 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; } @@ -580,11 +579,8 @@ libdnf5::GoalProblem GoalPrivate::protected_in_removals() { 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);