From 1df6f8c3d028f7109f2f198b67cf271b81631930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Tue, 25 Jun 2024 13:38:14 +0200 Subject: [PATCH] Set pool flag to fix pool_addfileprovides_queue() without filelists.xml Since dnf4 now also conditionally load filelists it ran into the same problem as dnf5 here: https://github.com/rpm-software-management/dnf5/issues/520 Additional details in: https://github.com/openSUSE/libsolv/pull/531 --- libdnf/dnf-sack.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp index 3c3a76578..e95009fb2 100644 --- a/libdnf/dnf-sack.cpp +++ b/libdnf/dnf-sack.cpp @@ -185,6 +185,13 @@ dnf_sack_init(DnfSack *sack) DnfSackPrivate *priv = GET_PRIVATE(sack); priv->pool = pool_create(); pool_set_flag(priv->pool, POOL_FLAG_WHATPROVIDESWITHDISABLED, 1); + + // Configures the pool_addfileprovides_queue() method to only add files from primary.xml. + // This ensures the method works correctly even if filelist.xml metadata are not loaded. + // At the same time when filelist.xml are loaded libsolv is able to search them for required + // files if needed. + pool_set_flag(priv->pool, POOL_FLAG_ADDFILEPROVIDESFILTERED, 1); + priv->running_kernel_id = -1; priv->running_kernel_fn = running_kernel; priv->considered_uptodate = TRUE;