Blob Blame History Raw
From f280bf6a30673d2eb29ebf9b5d6112cb999bcfe1 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Thu, 12 Mar 2020 15:32:23 -0400
Subject: [PATCH] Reset all module streams on upgrade to Fedora 32

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
 backends/dnf/pk-backend-dnf.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
index 503a6eb0ab4162f3f3eba60741e28d5c1f4bb21d..8c3e029e93406f75e08292769413072af9a7c405 100644
--- a/backends/dnf/pk-backend-dnf.c
+++ b/backends/dnf/pk-backend-dnf.c
@@ -3428,6 +3428,20 @@ pk_backend_upgrade_system_thread (PkBackendJob *job, GVariant *params, gpointer
 	/* set the installonly limit one higher than usual to avoid removing any kernels during system upgrades */
 	dnf_sack_set_installonly_limit (sack, dnf_context_get_installonly_limit (job_data->context) + 1);
 
+	/* Downstream hack to forcibly reset module defaults when upgrading
+	 * to Fedora 32.
+	 */
+	if (!pk_bitfield_contain (job_data->transaction_flags, PK_TRANSACTION_FLAG_ENUM_SIMULATE)) {
+		if (g_strcmp0 (release_ver, "32") == 0) {
+			ret = dnf_context_reset_all_modules (job_data->context, sack, &error);
+			if (!ret) {
+				g_debug ("failed to reset all modules: %s", error->message);
+				pk_backend_job_error_code (job, error->code, "%s", error->message);
+				return;
+			}
+		}
+	}
+
 	/* done */
 	if (!dnf_state_done (job_data->state, &error)) {
 		pk_backend_job_error_code (job, error->code, "%s", error->message);
-- 
2.24.1