]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-repackage-wo-lzma.patch
- fixed
[packages/rpm.git] / rpm-repackage-wo-lzma.patch
CommitLineData
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
6 #include <rpmio_internal.h>
7+#include <header_internal.h>
8 #include <rpmlib.h>
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"))
This page took 0.034275 seconds and 4 git commands to generate.