Blob Blame History Raw
From 0f9e61f8325c59d06894079d43773346a70448e2 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Mon, 11 Feb 2019 13:36:36 +0100
Subject: [PATCH] Exclude module pkgs that have conflict

---
 libdnf/module/ModulePackageContainer.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libdnf/module/ModulePackageContainer.cpp b/libdnf/module/ModulePackageContainer.cpp
index a8c7483..964d55e 100644
--- a/libdnf/module/ModulePackageContainer.cpp
+++ b/libdnf/module/ModulePackageContainer.cpp
@@ -518,6 +518,10 @@ ModulePackageContainer::Impl::moduleSolve(const std::vector<ModulePackagePtr> & 
         problems = goal.describeAllProblemRules(false);
         ret = goal.run(DNF_NONE);
         if (ret) {
+            // Conflicting modules has to be removed otherwice it could result than one of them will
+            // be active
+            auto conflictingPkgs = goal.listConflictPkgs(DNF_PACKAGE_STATE_AVAILABLE);
+            dnf_sack_add_excludes(moduleSack, conflictingPkgs.get());
             ret = goalWeak.run(DNF_NONE);
             if (ret) {
                 auto logger(libdnf::Log::getLogger());
--
libgit2 0.27.7