Nothing wrong with the patch __BUT__
As you saw, the LZMA guy does __NOT__ wish the ".lzma" suffix
convention to survive the year 2009.
73 de Jeff
On Oct 19, 2008, at 2:01 PM, Robert Scheck wrote:
> RPM Package Manager, CVS Repository
> http://rpm5.org/cvs/
>
> ____________________________________________________________________________
>
> Server: rpm5.org Name: Robert Scheck
> Root: /v/rpm/cvs Email: robert@rpm5.org
> Module: rpm Date: 19-Oct-2008 20:01:28
> Branch: HEAD Handle: 2008101918012701
>
> Modified files:
> rpm VENDOR
> rpm/rpmio macro.c
>
> Log:
> Enable extension-based-compression-detection change because of LZMA
> also for Fedora
>
> Summary:
> Revision Changes Path
> 2.57 +14 -0 rpm/VENDOR
> 2.204 +3 -3 rpm/rpmio/macro.c
>
> ____________________________________________________________________________
>
> patch -p0 <<'@@ .'
> Index: rpm/VENDOR
>
> =
> =
> =
> =
> =
> =
> ======================================================================
> $ cvs diff -u -r2.56 -r2.57 VENDOR
> --- rpm/VENDOR 11 Oct 2008 14:51:08 -0000 2.56
> +++ rpm/VENDOR 19 Oct 2008 18:01:27 -0000 2.57
> @@ -461,6 +461,20 @@
> "rpm -bb" operation.
>
> ________________________________________________________________________
>
> + Change: extension-based-compression-detection
> + Purpose: Prefer file extension for detecting file
> compression.
> + Reason: RPM tries to detect file compression by
> inspecting
> + "magic" bytes at the front of a file. This
> works for
> + formats with known "magic" bytes just fine,
> but fails
> + horribly for formats like LZMA where no such
> "magic"
> + bytes exist. For Fedora we prefer to first
> use file
> + extension based determination (if someone is
> mis-names
> + his distribution files we have to take action
> anyway)
> + and fall back to "magic" byte based
> determination only
> + if no well known extension is found.
> Additionally,
> + detecting LZMA we want to do via file
> extension only.
> +
> ________________________________________________________________________
> +
> o Name: MANDRIVA
> Vendor: Mandriva Linux <http://wiki.mandriva.com/>
> Representative: Per Øyvind Karlsen <pkarlsen@rpm5.org>
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/rpmio/macro.c
>
> =
> =
> =
> =
> =
> =
> ======================================================================
> $ cvs diff -u -r2.203 -r2.204 macro.c
> --- rpm/rpmio/macro.c 22 Aug 2008 04:39:01 -0000 2.203
> +++ rpm/rpmio/macro.c 19 Oct 2008 18:01:28 -0000 2.204
> @@ -2412,13 +2412,13 @@
> ssize_t nb;
> int rc = -1;
> unsigned char magic[13];
> -#if defined(RPM_VENDOR_OPENPKG) /* extension-based-compression-
> detection */
> +#if defined(RPM_VENDOR_OPENPKG) || defined(RPM_VENDOR_FEDORA) /*
> extension-based-compression-detection */
> size_t file_len;
> #endif
>
> *compressed = COMPRESSED_NOT;
>
> -#if defined(RPM_VENDOR_OPENPKG) /* extension-based-compression-
> detection */
> +#if defined(RPM_VENDOR_OPENPKG) || defined(RPM_VENDOR_FEDORA) /*
> extension-based-compression-detection */
> file_len = strlen(file);
> if ( (file_len > 4 && strcasecmp(file+file_len-4, ".tbz") ==
> 0)
> || (file_len > 4 && strcasecmp(file+file_len-4, ".bz2") ==
> 0)) {
> @@ -2483,7 +2483,7 @@
> && magic[2] == 'Z' && magic[3] == 'O') /* lzop */
> *compressed = COMPRESSED_LZOP;
> else
> -#if !defined(RPM_VENDOR_OPENPKG) /* extension-based-compression-
> detection */
> +#if !defined(RPM_VENDOR_OPENPKG) && !defined(RPM_VENDOR_FEDORA) /*
> extension-based-compression-detection */
> /* XXX Ick, LZMA has no magic. See http://lkml.org/lkml/2005/6/13/285
> */
> if (magic[ 9] == (unsigned char) 0x00 && magic[10] ==
> (unsigned char) 0x00 &&
> magic[11] == (unsigned char) 0x00 && magic[12] == (unsigned char)
> 0x00) /* lzmash */
> @@ .
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> CVS Sources Repository rpm-cvs@rpm5.org
Received on Sun Oct 19 21:53:06 2008