--- ./ext/repo_rpmdb.h_orig	2025-09-11 01:14:15.619432804 -0500
+++ ./ext/repo_rpmdb.h	2025-09-11 01:15:05.452126416 -0500
@@ -67,3 +67,5 @@
 extern void rpm_query_idarray(void *rpmhandle, Id what, Pool *pool, Queue *q, int flags);
 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	2025-09-11 01:16:19.612129226 -0500
+++ ./ext/solv_xfopen.h	2025-09-11 01:18:15.862490578 -0500
@@ -17,6 +17,7 @@
   #include <unistd.h>
 #endif
 
+#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);
@@ -25,4 +26,6 @@
 
 FILE *solv_cookieopen(void *cookie, const char *mode, ssize_t (*cread)(void *, char *, size_t), ssize_t (*cwrite)(void *, const char *, size_t), int (*cclose)(void *));	/* internal */
 
+extern gzFile save_gzf;
+extern gzFile fd_save_gzf;
 #endif
--- ./src/poolarch.c_orig	2025-09-11 01:18:49.982920325 -0500
+++ ./src/poolarch.c	2025-09-11 01:20:03.759254736 -0500
@@ -59,6 +59,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.h_orig	2025-09-11 01:21:01.196877031 -0500
+++ ./ext/solv_xmlparser.h	2025-09-11 01:21:38.314455406 -0500
@@ -55,3 +55,6 @@
 char *solv_xmlparser_contentspace(struct solv_xmlparser *xmlp, int l);
 
 
+#include <zlib.h>
+extern gzFile save_gzf;
+extern int from_repomdxml;
--- ./ext/solv_xmlparser.c_orig	2025-09-11 01:20:12.372126541 -0500
+++ ./ext/solv_xmlparser.c	2025-09-11 01:29:23.692136855 -0500
@@ -351,7 +351,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/repo_repomdxml.c_orig	2025-09-11 01:29:45.227777037 -0500
+++ ./ext/repo_repomdxml.c	2025-09-11 01:46:51.558753861 -0500
@@ -332,6 +332,8 @@
     }
 }
 
+int from_repomdxml = 0;
+
 int
 repo_add_repomdxml(Repo *repo, FILE *fp, int flags)
 {
@@ -346,9 +348,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))
--- ./ext/solv_xfopen.c_orig	2025-09-11 04:29:52.646159987 -0500
+++ ./ext/solv_xfopen.c	2025-09-11 04:39:20.194296784 -0500
@@ -20,6 +20,9 @@
 #include "solv_xfopen.h"
 #include "util.h"
 
+#define ENABLE_ZLIB_COMPRESSION
+#define ENABLE_BZIP2_COMPRESSION
+
 #ifndef WITHOUT_COOKIEOPEN
 
 FILE *solv_cookieopen(void *cookie, const char *mode,
@@ -60,6 +63,9 @@
 
 #include <zlib.h>
 
+gzFile save_gzf;
+gzFile fd_save_gzf;
+
 static ssize_t cookie_gzread(void *cookie, char *buf, size_t nbytes)
 {
   ssize_t r = gzread((gzFile)cookie, buf, nbytes);
@@ -83,10 +89,15 @@
   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 solv_cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
+  #endif
+  return gzf;
 }
 
 static inline FILE *mygzfdopen(int fd, const char *mode)
@@ -96,8 +107,8 @@
 }
 
 #endif
+#endif
 
-
 #ifdef ENABLE_BZIP2_COMPRESSION
 
 /* bzip2 compression */
@@ -120,19 +131,27 @@
   return 0;
 }
 
+#if 0
 static inline FILE *mybzfopen(const char *fn, const char *mode)
 {
   BZFILE *bzf = BZ2_bzopen(fn, mode);
+  #if 0
   return solv_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 solv_cookieopen(bzf, mode, cookie_bzread, cookie_bzwrite, cookie_bzclose);
+  #endif
+  return bzf;
 }
 
 #endif
+#endif
 
 
 #ifdef ENABLE_LZMA_COMPRESSION
@@ -653,6 +672,53 @@
 #undef ENABLE_ZCHUNK_COMPRESSION
 #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;
+ gzFile fd_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);
+   fd_save_gzf = gzf;
+ #if 0
+   return cookieopen(gzf, mode, cookie_gzread, cookie_gzwrite, cookie_gzclose);
+ #endif
+ return gzf;
+ 
+ }
 
 
 FILE *
@@ -668,6 +734,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);
@@ -759,6 +826,7 @@
       else
 	mode = simplemode = "r";
     }
+#define ENABLE_ZLIB_COMPRESSION
 #ifdef ENABLE_ZLIB_COMPRESSION
   if (suf && !strcmp(suf, ".gz"))
     return mygzfdopen(fd, simplemode);
@@ -786,6 +854,7 @@
       return 0;
     }
 #endif
+#define ENABLE_BZIP2_COMPRESSION
 #ifdef ENABLE_BZIP2_COMPRESSION
   if (suf && !strcmp(suf, ".bz2"))
     return mybzfdopen(fd, simplemode);
