From f6d333affb60e5364bf30355869fd359da2317e8 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 27 Apr 2022 01:33:35 +0200 Subject: Prepare for rpm-4.19: switch away from rpmteFI() Test Te->files btw (which shows it was segfaulting before...) --- RPM4/NEWS | 3 +++ RPM4/src/RPM4.xs | 12 ++++++++---- RPM4/t/05transaction.t | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'RPM4') diff --git a/RPM4/NEWS b/RPM4/NEWS index 70e15bf..92d9590 100644 --- a/RPM4/NEWS +++ b/RPM4/NEWS @@ -1,3 +1,6 @@ +- Adapt for rpm-4.19 +- Fix Te->file segfaulting + Version 0.45 - 27 April 2022 - Fix detecting 4.18-alpha1 diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index 3f252dc..71e23fa 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -1957,15 +1957,19 @@ void Te_files(Te) rpmte Te PREINIT: - rpmfi Files; + rpmfiles Files; + rpmfi fi; PPCODE: - Files = rpmteFI(Te); - if ((Files = rpmfiInit(Files, 0)) != NULL && rpmfiNext(Files) >= 0) { - mXPUSHs(sv_setref_pv(newSVpvs(""), bless_rpmfi, Files)); + Files = rpmteFiles(Te); + fi = rpmfilesIter(Files, RPMFI_ITER_FWD); + if (fi != NULL && rpmfiNext(fi) >= 0) { + mXPUSHs(sv_setref_pv(newSVpvs(""), bless_rpmfi, fi)); #ifdef HDRPMMEM PRINTF_NEW(bless_rpmfi, Files, Files->nrefs); #endif } + rpmfiFree(fi); + rpmfilesFree(Files); MODULE = RPM4 PACKAGE = RPM4 diff --git a/RPM4/t/05transaction.t b/RPM4/t/05transaction.t index 2a27ae8..18c8c17 100644 --- a/RPM4/t/05transaction.t +++ b/RPM4/t/05transaction.t @@ -56,6 +56,7 @@ ok($h, "Reading the header works"); ok($ts->transadd($h, "$Bin/test-rpm-1.0-1mdk.noarch.rpm") == 0, "Adding a package to transaction works"); ok($ts->traverse_transaction(sub { ok($_[0]->fullname, "Can get name from te"); + ok($_[0]->files, "Can get files from te"); ok($_[0]->type, "Can get type from te"); }), "traverse_transaction works"); -- cgit v1.2.1