ngompa / rpms / PackageKit

Forked from rpms/PackageKit 4 years ago
Clone

Blame SOURCES/0001-dnf-Invalidate-the-sack-cache-after-downloading-new-.patch

64c8ca
From cdbd27d699b51e37c533d07abd2f1ab26e11355c Mon Sep 17 00:00:00 2001
64c8ca
From: Kalev Lember <klember@redhat.com>
64c8ca
Date: Tue, 18 Dec 2018 01:02:27 +0100
64c8ca
Subject: [PATCH] dnf: Invalidate the sack cache after downloading new metadata
64c8ca
64c8ca
This fixes first resolve() after refresh() to correctly return the new
64c8ca
data.
64c8ca
64c8ca
https://bugzilla.redhat.com/show_bug.cgi?id=1642878
64c8ca
---
64c8ca
 backends/dnf/pk-backend-dnf.c | 4 ++++
64c8ca
 1 file changed, 4 insertions(+)
64c8ca
64c8ca
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
64c8ca
index 5961f1258..47e565915 100644
64c8ca
--- a/backends/dnf/pk-backend-dnf.c
64c8ca
+++ b/backends/dnf/pk-backend-dnf.c
64c8ca
@@ -1568,6 +1568,7 @@ pk_backend_refresh_cache_thread (PkBackendJob *job,
64c8ca
 				 gpointer user_data)
64c8ca
 {
64c8ca
 	PkBackendDnfJobData *job_data = pk_backend_job_get_user_data (job);
64c8ca
+	PkBackend *backend = pk_backend_job_get_backend (job);
64c8ca
 	DnfRepo *repo;
64c8ca
 	DnfState *state_local;
64c8ca
 	DnfState *state_loop;
64c8ca
@@ -1699,6 +1700,9 @@ pk_backend_refresh_cache_thread (PkBackendJob *job,
64c8ca
 		return;
64c8ca
 	}
64c8ca
 
64c8ca
+	/* invalidate the sack cache after downloading new metadata */
64c8ca
+	pk_backend_sack_cache_invalidate (backend, "downloaded new metadata");
64c8ca
+
64c8ca
 	/* regenerate the libsolv metadata */
64c8ca
 	state_local = dnf_state_get_child (job_data->state);
64c8ca
 	sack = dnf_utils_create_sack_for_filters (job, 0,
64c8ca
-- 
64c8ca
2.19.1
64c8ca