Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 0f39e4a976eddf8e03ac8c3eca77869c > files > 7

poldek-0.20-55563mdv2010.1.src.rpm

diff -p -up poldek-0.20/pm/rpm/rpm.c.rpm46~ poldek-0.20/pm/rpm/rpm.c
--- poldek-0.20/pm/rpm/rpm.c.rpm46~	2009-03-05 03:11:47.421939040 +0100
+++ poldek-0.20/pm/rpm/rpm.c	2009-03-05 03:13:52.376937955 +0100
@@ -33,6 +33,9 @@
 # include <rpm/rpmdb.h>
 #endif
 
+#ifdef _RPM_4_4_COMPAT
+#include <rpm/rpmlog.h>
+#endif
 #include <trurl/nassert.h>
 #include <trurl/narray.h>
 #include <trurl/nstr.h>
diff -p -up poldek-0.20/pm/rpm/rpmhdr.c.rpm46~ poldek-0.20/pm/rpm/rpmhdr.c
--- poldek-0.20/pm/rpm/rpmhdr.c.rpm46~	2009-03-05 03:17:10.352191610 +0100
+++ poldek-0.20/pm/rpm/rpmhdr.c	2009-03-05 03:23:58.594168776 +0100
@@ -99,7 +99,13 @@ int pm_rpmhdr_loadfile(const char *path,
     
     
     if ((fdt = Fopen(path, "r")) == NULL) {
-        logn(LOGERR, "open %s: %s", path, rpmErrorString());
+        logn(LOGERR, "open %s: %s", path,
+#ifdef _RPM_4_4_COMPAT
+			Fstrerror(fdt)
+#else
+			rpmErrorString()
+#endif
+			);
         
     } else {
         rc = pm_rpmhdr_loadfdt(fdt, hdr, path);
diff -p -up poldek-0.20/pm/rpm/signature.c.rpm46~ poldek-0.20/pm/rpm/signature.c
--- poldek-0.20/pm/rpm/signature.c.rpm46~	2005-05-24 21:54:14.000000000 +0200
+++ poldek-0.20/pm/rpm/signature.c	2009-03-05 03:11:10.390915933 +0100
@@ -60,10 +60,13 @@ typedef enum sigType_e {
 } sigType;
 rpmRC rpmReadSignature(FD_t fd, Header *sighp, sigType sig_type, const char ** msg);
 /* lib/rpmlead.h */
+#ifdef _RPM_4_4_COMPAT
+typedef struct rpmlead_s * rpmlead;
+rpmRC rpmLeadRead(FD_t fd, /*@out@*/ rpmlead lead);
+#else
 rpmRC readLead(FD_t fd, /*@out@*/ struct rpmlead *lead);
 #endif
-
-
+#endif
 
 /* seems foolish, just beacuse historical reasons */
 static int rpm_read_signature(FD_t fd, Header *sighp, int sig_type)
@@ -74,8 +77,9 @@ static int rpm_read_signature(FD_t fd, H
     return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
 #elif HAVE_RPM_4_0
     return rpmReadSignature(fd, sighp, sig_type, NULL) == 0;
-#endif
+#else
     return 0;
+#endif
 }
     
 /* rpmlib's rpmCheckSig reports success when GPG signature is missing,
@@ -93,7 +97,7 @@ static int rpm_signatures(const char *pa
 {
     unsigned        flags;
     FD_t            fdt;
-    struct rpmlead  lead;
+    rpmlead  lead;
     Header          sign = NULL;
     int32_t         tag, type, cnt;
     const void      *ptr;
@@ -108,13 +112,21 @@ static int rpm_signatures(const char *pa
         return 0;
     }
 
+#ifdef _RPM_4_4_COMPAT
+    if (rpmLeadRead(fdt, lead) != 0) {
+#else
     if (readLead(fdt, &lead) != 0) {
+#endif
         logn(LOGERR, "%s: read package lead failed", n_basenam(path));
         Fclose(fdt);
         return 0;
     }
 
+#ifdef _RPM_4_4_COMPAT
+    if (!rpm_read_signature(fdt, &sign, RPMSIGTYPE_HEADERSIG)) {
+#else
     if (!rpm_read_signature(fdt, &sign, lead.signature_type)) {
+#endif
         logn(LOGERR, "%s: read package signature failed", n_basenam(path));
         Fclose(fdt);
         return 0;