SOURCES: rpm-repackage-wo-lzma.patch (NEW) - when repackaging if l...

witekfl witekfl at pld-linux.org
Mon Sep 25 20:05:56 CEST 2006


Author: witekfl                      Date: Mon Sep 25 18:05:56 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- when repackaging if lzma is not installed use gzip
- digest of signature is bad, so one must install or uninstall
  repackaged packages using --nodigest

---- Files affected:
SOURCES:
   rpm-repackage-wo-lzma.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/rpm-repackage-wo-lzma.patch
diff -u /dev/null SOURCES/rpm-repackage-wo-lzma.patch:1.1
--- /dev/null	Mon Sep 25 20:05:56 2006
+++ SOURCES/rpm-repackage-wo-lzma.patch	Mon Sep 25 20:05:51 2006
@@ -0,0 +1,42 @@
+--- 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 <rpmio_internal.h>
++#include <header_internal.h>
+ #include <rpmlib.h>
+ #include <rpmmacro.h>
+ #include <rpmurl.h>
+@@ -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"))
================================================================


More information about the pld-cvs-commit mailing list