diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2022-04-29 11:04:38 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2022-04-29 13:15:14 +0200 |
commit | 1bc61ee3959a47013be5b12a902e4ba575fa2aaa (patch) | |
tree | 628642163f28e11e781ceade32ecb82fa0800f4f | |
parent | 94eed1e1b4bc848d7646b60dc8d425d7ee30c052 (diff) | |
download | perl-RPM4-1bc61ee3959a47013be5b12a902e4ba575fa2aaa.tar perl-RPM4-1bc61ee3959a47013be5b12a902e4ba575fa2aaa.tar.gz perl-RPM4-1bc61ee3959a47013be5b12a902e4ba575fa2aaa.tar.bz2 perl-RPM4-1bc61ee3959a47013be5b12a902e4ba575fa2aaa.tar.xz perl-RPM4-1bc61ee3959a47013be5b12a902e4ba575fa2aaa.zip |
(Te_files) make it compile again with rpm < 4.12
Technically the old code would compile up to 4.18 but:
- rpmteFI() has been obsoleted in 4.12
- it segfaults (see next commit) whereas new code path works in 4.18
-rw-r--r-- | RPM4/src/Makefile.PL | 1 | ||||
-rw-r--r-- | RPM4/src/RPM4.xs | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL index 527fb47..025f5c8 100644 --- a/RPM4/src/Makefile.PL +++ b/RPM4/src/Makefile.PL @@ -39,6 +39,7 @@ print $FH ' * $Id$' . "\n"; print $FH " */\n\n"; print $FH "#ifndef RPMVERSION_H\n#define RPMVERSION_H\n\n"; foreach (qw( + 4.12.0 4.12.90 4.15.0 )) { diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index dbbbd28..5000e7e 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -1957,18 +1957,27 @@ void Te_files(Te) rpmte Te PREINIT: +#if defined(RPM4_12_0) rpmfiles Files; +#endif rpmfi fi; PPCODE: +#if defined(RPM4_12_0) Files = rpmteFiles(Te); fi = rpmfilesIter(Files, RPMFI_ITER_FWD); if (fi != NULL && rpmfiNext(fi) >= 0) { +#else + fi = rpmteFI(Te); + if ((fi = rpmfiInit(fi, 0)) != NULL && rpmfiNext(fi) >= 0) { +#endif mXPUSHs(sv_setref_pv(newSVpvs(""), bless_rpmfi, fi)); #ifdef HDRPMMEM PRINTF_NEW(bless_rpmfi, Files, Files->nrefs); #endif } +#if defined(RPM4_12_0) rpmfilesFree(Files); +#endif MODULE = RPM4 PACKAGE = RPM4 |