--- ./ext/repo_rpmdb.h_orig	2020-02-12 06:43:06 +0000
+++ ./ext/repo_rpmdb.h	2020-02-12 06:43:44 +0000
@@ -60,3 +60,5 @@
 extern unsigned long long rpm_query_num(void *rpmhandle, Id what, unsigned long long notfound);
 extern void rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char *, struct filelistinfo *), void *cbdata);
 extern Id   repo_add_rpm_handle(Repo *repo, void *rpmhandle, int flags);
+
+extern int from_rpmmd = 0;
--- ./ext/solv_xfopen.h_orig	2020-02-12 07:20:46 +0000
+++ ./ext/solv_xfopen.h	2020-02-12 07:21:16 +0000
@@ -8,9 +8,11 @@
 #ifndef SOLV_XFOPEN_H
 #define SOLV_XFOPEN_H
 
+#include <zlib.h>
 extern FILE *solv_xfopen(const char *fn, const char *mode);
 extern FILE *solv_xfopen_fd(const char *fn, int fd, const char *mode);
 extern FILE *solv_xfopen_buf(const char *fn, char **bufp, size_t *buflp, const char *mode);
 extern int   solv_xfopen_iscompressed(const char *fn);
 
+extern gzFile save_gzf;
 #endif
--- ./src/poolarch.c_orig	2020-02-12 07:21:46 +0000
+++ ./src/poolarch.c	2020-02-12 07:22:10 +0000
@@ -53,6 +53,7 @@
   "sparcv9v",	"sparcv9v:sparcv9:sparcv8:sparc",
   "sparcv9",	"sparcv9:sparcv8:sparc",
   "sparcv8",	"sparcv8:sparc",
+  "ppc", "ppc",
 #if defined(FEDORA) || defined(MAGEIA)
   "ia32e",	"ia32e:x86_64:athlon:i686:i586:i486:i386",
   "athlon",	"athlon:i686:i586:i486:i386",
--- ./ext/solv_xmlparser.c_orig	2020-02-13 04:48:03 +0000
+++ ./ext/solv_xmlparser.c	2020-02-13 04:49:38 +0000
@@ -307,7 +307,10 @@
     }
   for (;;)
     {
-      l = fread(buf, 1, sizeof(buf), fp);
+      if (from_repomdxml)
+          l = fread(buf, 1, sizeof(buf), fp);
+      else
+          l = gzread(save_gzf, buf, sizeof(buf)); 
       if (!parse_block(xmlp, buf, l))
 	{
 	  ret = SOLV_XMLPARSER_ERROR;
--- ./ext/solv_xmlparser.h_orig	2020-02-13 05:04:43 +0000
+++ ./ext/solv_xmlparser.h	2020-02-13 05:22:31 +0000
@@ -52,5 +52,6 @@
 extern int solv_xmlparser_parse(struct solv_xmlparser *xmlp, FILE *fp);
 unsigned int solv_xmlparser_lineno(struct solv_xmlparser *xmlp);
 char *solv_xmlparser_contentspace(struct solv_xmlparser *xmlp, int l);
-
-
+#include <zlib.h>
+extern gzFile save_gzf;
+extern int from_repomdxml;
--- ./ext/solv_xfopen.c_orig	2020-02-12 06:45:34 +0000
+++ ./ext/solv_xfopen.c	2020-02-14 02:13:09 +0000
@@ -19,6 +19,9 @@
 #include "solv_xfopen.h"
 #include "util.h"
 
+#define ENABLE_ZLIB_COMPRESSION
+#define ENABLE_BZIP2_COMPRESSION
+
 #ifndef WITHOUT_COOKIEOPEN
 
 static FILE *cookieopen(void *cookie, const char *mode,
@@ -59,6 +62,8 @@
 
 #include <zlib.h>
 
+gzFile save_gzf;
+
 static ssize_t cookie_gzread(void *cookie, char *buf, size_t nbytes)
 {
   return gzread((gzFile)cookie, buf, nbytes);
@@ -74,19 +79,28 @@
   return gzclose((gzFile)cookie);
 }
 
+#if 0
 static inline FILE *mygzfopen(const char *fn, const char *mode)
 {
   gzFile gzf = gzopen(fn, mode);
+  save_gzf = gzf;
+  #if 0
   return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
+  #endif
+  return gzf;
 }
 
 static inline FILE *mygzfdopen(int fd, const char *mode)
 {
   gzFile gzf = gzdopen(fd, mode);
+  #if 0
   return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
+  #endif
+  return gzf;
 }
 
 #endif
+#endif
 
 
 #ifdef ENABLE_BZIP2_COMPRESSION
@@ -111,17 +125,25 @@
   return 0;
 }
 
+#if 0
 static inline FILE *mybzfopen(const char *fn, const char *mode)
 {
   BZFILE *bzf = BZ2_bzopen(fn, mode);
+  #if 0
   return cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+  #endif
+  return bzf;
 }
 
 static inline FILE *mybzfdopen(int fd, const char *mode)
 {
   BZFILE *bzf = BZ2_bzdopen(fd, mode);
+  #if 0
   return cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+  #endif
+  return bzf;
 }
+#endif
 
 #endif
 
@@ -617,6 +639,51 @@
 #endif
 
 
+ #define ENABLE_BZIP2_COMPRESSION
+ #include <bzlib.h>
+ static inline FILE *mybzfopen(const char *fn, const char *mode)
+ {
+   BZFILE *bzf = BZ2_bzopen(fn, mode);
+ #if 0
+   return cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+ #endif
+ return bzf;
+ }
+ 
+ static inline FILE *mybzfdopen(int fd, const char *mode)
+ {
+   BZFILE *bzf = BZ2_bzdopen(fd, mode);
+ #if 0
+   return cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+ #endif
+ return bzf;
+ }
+ 
+ 
+ #define ENABLE_ZLIB_COMPRESSION
+ #include <zlib.h>
+ 
+ gzFile save_gzf;
+ 
+ static inline FILE *mygzfopen(const char *fn, const char *mode)
+ {
+   gzFile gzf = gzopen(fn, mode);
+   save_gzf = gzf;
+ #if 0
+   return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
+ #endif
+  return gzf;
+ }
+ 
+ static inline FILE *mygzfdopen(int fd, const char *mode)
+ {
+   gzFile gzf = gzdopen(fd, mode);
+ #if 0
+   return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
+ #endif
+ return (FILE *)gzf;
+ 
+ }
 
 FILE *
 solv_xfopen(const char *fn, const char *mode)
@@ -628,6 +695,7 @@
   if (!mode)
     mode = "r";
   suf = strrchr(fn, '.');
+#define ENABLE_ZLIB_COMPRESSION
 #ifdef ENABLE_ZLIB_COMPRESSION
   if (suf && !strcmp(suf, ".gz"))
     return mygzfopen(fn, mode);
@@ -646,6 +714,7 @@
   if (suf && !strcmp(suf, ".lzma"))
     return 0;
 #endif
+#define ENABLE_BZIP2_COMPRESSION
 #ifdef ENABLE_BZIP2_COMPRESSION
   if (suf && !strcmp(suf, ".bz2"))
     return mybzfopen(fn, mode);
@@ -701,6 +770,7 @@
       else
 	mode = simplemode = "r";
     }
+#define ENABLE_ZLIB_COMPRESSION
 #ifdef ENABLE_ZLIB_COMPRESSION
   if (suf && !strcmp(suf, ".gz"))
     return mygzfdopen(fd, simplemode);
--- ./ext/repo_repomdxml.c_orig	2020-02-12 06:41:13 +0000
+++ ./ext/repo_repomdxml.c	2020-02-14 02:47:31 +0000
@@ -329,6 +329,8 @@
     }
 }
 
+int from_repomdxml = 0;
+
 int
 repo_add_repomdxml(Repo *repo, FILE *fp, int flags)
 {
@@ -343,9 +345,11 @@
   pd.pool = pool;
   pd.repo = repo;
   pd.data = data;
+  from_repomdxml = 1;
   solv_xmlparser_init(&pd.xmlp, stateswitches, &pd, startElement, endElement);
   if (solv_xmlparser_parse(&pd.xmlp, fp) != SOLV_XMLPARSER_OK)
     pd.ret = pool_error(pd.pool, -1, "repo_repomdxml: %s at line %u:%u", pd.xmlp.errstr, pd.xmlp.line, pd.xmlp.column);
+  from_repomdxml = 0;
   solv_xmlparser_free(&pd.xmlp);
 
   if (!(flags & REPO_NO_INTERNALIZE))
