Blob Blame History Raw
From 2966afe44eaa24d143af4cac02d9a84cb343aa3b Mon Sep 17 00:00:00 2001
From: Jonathan Lebon <jonathan@jlebon.com>
Date: Tue, 7 Jan 2020 17:25:12 -0500
Subject: [PATCH] core: Mark all repos as "modular hotfixes"

This is a follow-up hack to #1797 to force libdnf to let us use modular
packages as if they were regular packages until we actually support
modules correctly (#1435).

A repo marked as a modular hotfix means that libdnf doesn't try to
filter out modular RPMs from the repo as it usually does.

Resolves: https://pagure.io/releng/failed-composes/issue/717
---
 src/libpriv/rpmostree-core.c |  6 ++++++
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/libpriv/rpmostree-core.c b/src/libpriv/rpmostree-core.c
index 5ec673db..b0e7150a 100644
--- a/src/libpriv/rpmostree-core.c
+++ b/src/libpriv/rpmostree-core.c
@@ -1158,6 +1158,12 @@ rpmostree_context_download_metadata (RpmOstreeContext *self,
    * So for now, let's tell libdnf that we do want to be able to see them. See:
    * https://github.com/projectatomic/rpm-ostree/issues/1435 */
   dnf_sack_set_module_excludes (dnf_context_get_sack (self->dnfctx), NULL);
+  /* And also mark all repos as hotfix repos so that we can indiscriminately cherry-pick
+   * from modular repos and non-modular repos alike. */
+  g_autoptr(GPtrArray) repos =
+    rpmostree_get_enabled_rpmmd_repos (self->dnfctx, DNF_REPO_ENABLED_PACKAGES);
+  for (guint i = 0; i < repos->len; i++)
+    dnf_repo_set_module_hotfixes (repos->pdata[i], TRUE);
 
   return TRUE;
 }
 
-- 
2.24.1