aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2017-11-01 01:30:39 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2017-11-06 20:53:58 +0100
commite6aa740fd1cdddfcf6b2df6be7334f93366e1cce (patch)
tree0e24560e6a827e1d13aea7f57512db8b9879983f
parentfb43f786ea2bb06a1a5e3c7629dcf5bbe1270205 (diff)
downloadperl-URPM-e6aa740fd1cdddfcf6b2df6be7334f93366e1cce.tar
perl-URPM-e6aa740fd1cdddfcf6b2df6be7334f93366e1cce.tar.gz
perl-URPM-e6aa740fd1cdddfcf6b2df6be7334f93366e1cce.tar.bz2
perl-URPM-e6aa740fd1cdddfcf6b2df6be7334f93366e1cce.tar.xz
perl-URPM-e6aa740fd1cdddfcf6b2df6be7334f93366e1cce.zip
restore rpm-4.13.x compatibility
-rw-r--r--NEWS1
-rw-r--r--URPM.xs10
2 files changed, 11 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 5583e47..0895e66 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
- make clear URPM needs rpm >= 4.14
- revert fix for segfault with rpm-4.14 when checking invalid signatures as rpm
got fixed
+- restore rpm-4.13.x compatibility
- use ExtUtils::PkgConfig in order to get rpm installed
- cpan testers:
o add cflags reported by pkgconfig
diff --git a/URPM.xs b/URPM.xs
index 8926770..ef3254b 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -11,6 +11,7 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#include "rpmversion.h"
#include <sys/utsname.h>
#include <sys/select.h>
@@ -2990,6 +2991,11 @@ Urpm_parse_hdlist__XS(urpm, filename, ...)
} else croak("first argument should contain a depslist ARRAY reference");
} else croak("first argument should be a reference to a HASH");
+
+#ifndef RPM4_14_0
+#define RPMVSF_NOPAYLOAD RPMVSF_NOSHA1
+#define RPMVSF_NOSHA256HEADER RPMVSF_NOMD5HEADER
+#endif
void
Urpm_parse_rpm(urpm, filename, ...)
SV *urpm
@@ -3117,7 +3123,11 @@ Urpm_get_gpg_fingerprint(filename)
pktlen = 0;
else {
unsigned int i;
+#ifdef RPM4_14_0
pgpPubkeyKeyID (pkt, pktlen, fingerprint);
+#else
+ pgpPubkeyFingerprint (pkt, pktlen, fingerprint);
+#endif
for (i = 0; i < sizeof (pgpKeyID_t); i++)
sprintf(&fingerprint_str[i*2], "%02x", fingerprint[i]);
}