]>
Commit | Line | Data |
---|---|---|
e78604ef | 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 | |
3 | @@ -6,6 +6,7 @@ | |
4 | #include "system.h" | |
5 | ||
e04c27a7 | 6 | #include <rpmio_internal.h> /* XXX FDSTAT_READ */ |
e78604ef | 7 | +#include <header_internal.h> |
e04c27a7 | 8 | #include <rpmcb.h> /* XXX fnpyKey */ |
e78604ef | 9 | #include <rpmmacro.h> |
10 | #include <rpmurl.h> | |
11 | @@ -1403,6 +1404,19 @@ | |
12 | return rpmpsmStage(psm, psm->nstage); | |
13 | } | |
14 | ||
15 | +static void replace_lzma_with_gzip(Header h) | |
16 | +{ | |
17 | + indexEntry entry; | |
18 | + int i; | |
19 | + | |
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); | |
23 | + break; | |
24 | + } | |
25 | + } | |
26 | +} | |
27 | + | |
28 | /** | |
29 | * @todo Packages w/o files never get a callback, hence don't get displayed | |
30 | * on install with -v. | |
31 | @@ -2151,6 +2165,11 @@ | |
32 | payload_compressor = "gzip"; | |
33 | /*@=branchstate@*/ | |
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); | |
39 | + } | |
40 | *t = '\0'; | |
41 | t = stpcpy(t, ((psm->goal == PSM_PKGSAVE) ? "w9" : "r")); | |
42 | if (!strcmp(payload_compressor, "gzip")) |