Mailinglist Archive: zypp-devel (40 mails)

< Previous Next >
[zypp-devel] [PATCH] Fix for recent sat-solver changes and Rpm 4.7
  • From: Lorenzo Villani <lvillani@xxxxxxxxxxxxxxx>
  • Date: Mon, 6 Jul 2009 22:09:12 +0200
  • Message-id: <200907062209.18449.lvillani@xxxxxxxxxxxxxxx>
The changeset 318bbe263d25517cc6a7ca9e67b7f1bd8088469d introduced a new private
structure copied from RPM sources called pgpDigParams_s which seems to use a
'byte' type defined somewhere in legacy RPM code (I guess it is just a typedef,
maybe I'm wrong).

This 'byte' type is not defined in RPM >= 4.7 and the structure itself has
changed a bit.

It seems that 'byte' has changed to 'uint8_t' nearly everywhere with a couple
of
exceptions. However, I found it easier to copy the structure from rpm 4.7
sources and leverage the existing 'FEDORA' value to wrap it in an #ifdef block.

The testsuite runs 100% fine but I'm testing it with some real-world usage. :-)

Cheers,
L.V.
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
index 105a24a..4101a99 100644
--- a/ext/repo_rpmdb.c
+++ b/ext/repo_rpmdb.c
@@ -2698,8 +2698,35 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char
*p, int pl)
repodata_set_num(data, s - s->repo->pool->solvables, PUBKEY_EXPIRES,
maxex);
}

-/* this is private to rpm, but rpm lacks an interface to retrieve
- * the values. Sigh. */
+
+/*
+ * The following struct is private to rpm, but rpm lacks an interface to
retrieve
+ * the values. Sigh.
+ * Rpm 4.7 changed the interface a little so we have to build the correct
version on Fedora.
+ * Sigh^2.
+ */
+#ifdef FEDORA
+struct pgpDigParams_s {
+ char * userid;
+ uint8_t * hash;
+ char * params[4];
+ uint8_t tag;
+
+ uint8_t version; /*!< version number. */
+ pgpTime_t time; /*!< time that the key was created. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
+
+ uint8_t hash_algo;
+ uint8_t sigtype;
+ uint8_t hashlen;
+ uint8_t signhash16[2];
+ pgpKeyID_t signid;
+ uint8_t saved;
+#define PGPDIG_SAVED_TIME (1 << 0)
+#define PGPDIG_SAVED_ID (1 << 1)
+
+};
+#else
struct pgpDigParams_s {
const char * userid;
const byte * hash;
@@ -2715,6 +2742,7 @@ struct pgpDigParams_s {
byte signid[8];
byte saved;
};
+#endif

struct pgpDig_s {
struct pgpDigParams_s signature;
< Previous Next >
This Thread
  • No further messages