From f43314b51a3971a197f3a46b782c4378e0d97e15 Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Wed, 20 May 2026 14:40:48 -0400 Subject: [PATCH] swig: Add missing %template for std::vector Resolves: RHEL-154734 --- ...-template-for-std-vector-Transaction.patch | 35 +++++++++++++++++++ libdnf.spec | 6 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0041-swig-Add-missing-template-for-std-vector-Transaction.patch diff --git a/0041-swig-Add-missing-template-for-std-vector-Transaction.patch b/0041-swig-Add-missing-template-for-std-vector-Transaction.patch new file mode 100644 index 0000000..8c5900d --- /dev/null +++ b/0041-swig-Add-missing-template-for-std-vector-Transaction.patch @@ -0,0 +1,35 @@ +From e5a7516c4c865f2b8e186e957d03abf965057382 Mon Sep 17 00:00:00 2001 +From: Evan Goode +Date: Mon, 9 Mar 2026 22:23:45 -0400 +Subject: [PATCH] swig: Add missing %template for + std::vector + +MergedTransaction::listPersistences() returns std::vector, +but no SWIG %template was declared for this type. Without it, SWIG wraps the +return value as an opaque pointer instead of a Python list, causing memory leak +warnings and preventing Python code from iterating over the values. + +Add the missing template, matching the existing TransactionStateVector pattern. + +For: https://github.com/rpm-software-management/libdnf/issues/1744 + +Assisted-by: Claude Opus 4.6 +--- + bindings/swig/transaction.i | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/bindings/swig/transaction.i b/bindings/swig/transaction.i +index c5fe04d8e..e1299b05f 100644 +--- a/bindings/swig/transaction.i ++++ b/bindings/swig/transaction.i +@@ -80,6 +80,7 @@ typedef libdnf::CompsPackageType CompsPackageType; + %template() std::vector >; + %template() std::vector >; + %template(TransactionStateVector) std::vector; ++%template(TransactionPersistenceVector) std::vector; + + %template() std::vector; + %template() std::vector; +-- +2.54.0 + diff --git a/libdnf.spec b/libdnf.spec index 107ff8a..4357e37 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -58,7 +58,7 @@ Name: libdnf Version: %{libdnf_major_version}.%{libdnf_minor_version}.%{libdnf_micro_version} -Release: 18%{?dist} +Release: 19%{?dist} Summary: Library providing simplified C and Python API to libsolv License: LGPLv2+ URL: https://github.com/rpm-software-management/libdnf @@ -103,6 +103,7 @@ Patch37: 0037-Add-filterUnneededExtraUserinstalled-and-Python-vers.patch Patch38: 0038-Describe-all-problems-even-when-there-are-protected-.patch Patch39: 0039-Clearer-error-for-protected-package-broken-dependenc.patch Patch40: 0040-Goal-set-protected-as-userinstalled-only-for-the-tem.patch +Patch41: 0041-swig-Add-missing-template-for-std-vector-Transaction.patch BuildRequires: cmake @@ -352,6 +353,9 @@ popd %endif %changelog +* Wed May 20 2026 Evan Goode - 0.69.0-19 +- swig: Add missing %template for std::vector (RHEL-154734) + * Mon Feb 09 2026 Ales Matej - 0.69.0-18 - Fix a crash when parsing multiple key files fails (RHEL-145618) - Mark all protected packages as user installed for all transactions (RHEL-76112)