--- rpm-4.4.6/lib/psm.c.old 2006-09-25 17:55:05.000000000 +0200 +++ rpm-4.4.6/lib/psm.c 2006-09-25 19:40:47.000000000 +0200 @@ -6,6 +6,7 @@ #include "system.h" #include +#include #include #include #include @@ -1403,6 +1404,19 @@ return rpmpsmStage(psm, psm->nstage); } +static void replace_lzma_with_gzip(Header h) +{ + indexEntry entry; + int i; + + for (i = 0, entry = h->index; i < h->indexUsed; i++, entry++) { + if (entry->info.tag == RPMTAG_PAYLOADCOMPRESSOR) { + memcpy(entry->data, "gzip", 4); + break; + } + } +} + /** * @todo Packages w/o files never get a callback, hence don't get displayed * on install with -v. @@ -2151,6 +2165,11 @@ payload_compressor = "gzip"; /*@=branchstate@*/ psm->rpmio_flags = t = xmalloc(sizeof("w9.gzdio")); + if (psm->goal == PSM_PKGSAVE && !strcmp(payload_compressor, "lzma") && access("/usr/bin/lzma", X_OK)) { + /* FIXME: digest is bad. */ + payload_compressor = "gzip"; + replace_lzma_with_gzip(psm->oh); + } *t = '\0'; t = stpcpy(t, ((psm->goal == PSM_PKGSAVE) ? "w9" : "r")); if (!strcmp(payload_compressor, "gzip"))