Blame SOURCES/0001-dnf-Don-t-override-DnfContext-s-release_ver-for-the-.patch

64c8ca
From be075445cafd370abf1ad3e6e85f2baebef056cb Mon Sep 17 00:00:00 2001
64c8ca
From: Kalev Lember <klember@redhat.com>
64c8ca
Date: Wed, 30 Jan 2019 15:37:21 +0100
64c8ca
Subject: [PATCH] dnf: Don't override DnfContext's release_ver for the running
64c8ca
 system
64c8ca
64c8ca
Only override release_ver for the system upgrade DnfContext and leave it
64c8ca
at the default value for the default context. This makes
64c8ca
dnf_context_setup() automatically figure out the release_ver based on
64c8ca
the running system: it looks at various provides in rpmdb and finally
64c8ca
falls back to VERSION_ID from /etc/os-release.
64c8ca
64c8ca
The goal here is to make it possible to adjust the value that gets
64c8ca
passed to librepo by changing system-release(releasever) provides in
64c8ca
fedora-release (which DnfContext correctly handles if we leave the
64c8ca
release_ver set to the default value).
64c8ca
64c8ca
https://pagure.io/releng/issue/7445
64c8ca
---
64c8ca
 backends/dnf/pk-backend-dnf.c | 2 +-
64c8ca
 1 file changed, 1 insertion(+), 1 deletion(-)
64c8ca
64c8ca
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
64c8ca
index 47e565915..779896c2d 100644
64c8ca
--- a/backends/dnf/pk-backend-dnf.c
64c8ca
+++ b/backends/dnf/pk-backend-dnf.c
64c8ca
@@ -156,7 +156,6 @@ pk_backend_setup_dnf_context (DnfContext *context, GKeyFile *conf, const gchar *
64c8ca
 	dnf_context_set_repo_dir (context, repo_dir);
64c8ca
 	lock_dir = g_build_filename (destdir, "/var/run", NULL);
64c8ca
 	dnf_context_set_lock_dir (context, lock_dir);
64c8ca
-	dnf_context_set_release_ver (context, release_ver);
64c8ca
 	dnf_context_set_rpm_verbosity (context, "info");
64c8ca
 
64c8ca
 	/* use this initial data if repos are not present */
64c8ca
@@ -3401,6 +3400,7 @@ pk_backend_upgrade_system_thread (PkBackendJob *job, GVariant *params, gpointer
64c8ca
 		g_autoptr(DnfContext) context = NULL;
64c8ca
 
64c8ca
 		context = dnf_context_new ();
64c8ca
+		dnf_context_set_release_ver (context, release_ver);
64c8ca
 		ret = pk_backend_setup_dnf_context (context, priv->conf, release_ver, &error);
64c8ca
 		if (!ret) {
64c8ca
 			g_debug ("failed to setup context: %s", error->message);
64c8ca
-- 
64c8ca
2.21.0
64c8ca