1 --- rpm-4.4.6/lib/psm.c.old 2006-09-25 17:55:05.000000000 +0200
2 +++ rpm-4.4.6/lib/psm.c 2006-09-25 19:40:47.000000000 +0200
6 #include <rpmio_internal.h> /* XXX FDSTAT_READ */
7 +#include <header_internal.h>
8 #include <rpmcb.h> /* XXX fnpyKey */
11 @@ -1403,6 +1404,19 @@
12 return rpmpsmStage(psm, psm->nstage);
15 +static void replace_lzma_with_gzip(Header h)
20 + for (i = 0, entry = h->index; i < h->indexUsed; i++, entry++) {
21 + if (entry->info.tag == RPMTAG_PAYLOADCOMPRESSOR) {
22 + memcpy(entry->data, "gzip", 4);
29 * @todo Packages w/o files never get a callback, hence don't get displayed
31 @@ -2151,6 +2165,11 @@
32 payload_compressor = "gzip";
34 psm->rpmio_flags = t = xmalloc(sizeof("w9.gzdio"));
35 + if (psm->goal == PSM_PKGSAVE && !strcmp(payload_compressor, "lzma") && access("/usr/bin/lzma", X_OK)) {
36 + /* FIXME: digest is bad. */
37 + payload_compressor = "gzip";
38 + replace_lzma_with_gzip(psm->oh);
41 t = stpcpy(t, ((psm->goal == PSM_PKGSAVE) ? "w9" : "r"));
42 if (!strcmp(payload_compressor, "gzip"))