From b20b2dbef5d7e6297a07ef347dd0521505b87903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 2 Jul 2024 15:30:58 +0200 Subject: [PATCH] Fix sack initialization to enable postponed addition of filelists Resolves: RHEL-12355 --- ...-fix-pool_addfileprovides_queue-with.patch | 40 +++++++++++++++++++ libdnf.spec | 6 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 0004-Set-pool-flag-to-fix-pool_addfileprovides_queue-with.patch diff --git a/0004-Set-pool-flag-to-fix-pool_addfileprovides_queue-with.patch b/0004-Set-pool-flag-to-fix-pool_addfileprovides_queue-with.patch new file mode 100644 index 0000000..63cf3ef --- /dev/null +++ b/0004-Set-pool-flag-to-fix-pool_addfileprovides_queue-with.patch @@ -0,0 +1,40 @@ +From a6d89d66698f75c01539cd03c04a87ab52b6db7c 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 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 + +Signed-off-by: Petr Písař +--- + libdnf/dnf-sack.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp +index 3c3a7657..e95009fb 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; +-- +2.45.2 + diff --git a/libdnf.spec b/libdnf.spec index 8c34479..1613440 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -56,7 +56,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 3%{?dist} +Release: 4%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPL-2.1-or-later URL: https://github.com/rpm-software-management/libdnf @@ -64,6 +64,7 @@ Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch1: 0001-context-use-rpmtsAddReinstallElement-when-doing-a-re.patch Patch2: 0002-Since-we-use-rpmtsAddReinstallElement-rpm-also-unins.patch Patch3: 0003-MergedTransaction-Fix-invalid-memory-access-when-dro.patch +Patch4: 0004-Set-pool-flag-to-fix-pool_addfileprovides_queue-with.patch BuildRequires: cmake BuildRequires: gcc @@ -307,6 +308,9 @@ popd %endif %changelog +* Tue Jul 02 2024 Petr Pisar - 0.73.1-4 +- Fix sack initialization to enable postponed addition of filelists (RHEL-12355) + * Mon Jun 24 2024 Troy Dawson - 0.73.1-3 - Bump release for June 2024 mass rebuild