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

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