lzip-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lzip-bug] lzip for rpm


From: Jan Engelhardt
Subject: [Lzip-bug] lzip for rpm
Date: Thu, 20 Nov 2008 21:25:12 +0100 (CET)
User-agent: Alpine 1.10 (LNX 962 2008-03-14)

On Thursday 2008-11-20 20:30, Antonio Diaz Diaz wrote:

> Jan Engelhardt wrote:
>> I was just adding support for lzip source tarballs to rpm.
>
> Excellent news. Thanks.

Oh yeah here is a copy for the archives.

---
 build/parsePrep.c   |    3 +++
 configure.ac        |    1 +
 file/src/compress.c |    1 +
 macros.in           |    1 +
 rpmio/macro.c       |    6 ++++++
 rpmio/rpmmacro.h    |    1 +
 6 files changed, 13 insertions(+)

Base: openSUSE 11.0 rpm 4.4.2
Index: rpm-4.4.2/build/parsePrep.c
===================================================================
--- rpm-4.4.2.orig/build/parsePrep.c
+++ rpm-4.4.2/build/parsePrep.c
@@ -241,6 +241,9 @@ static int checkOwners(const char * urlf
        case COMPRESSED_OTHER:
            t = "%{_gzipbin} -dc";
            break;
+       case COMPRESSED_LZIP:
+           t = "%__lzip -dc";
+           break;
        case COMPRESSED_BZIP2:
            t = "%{_bzip2bin} -dc";
            break;
Index: rpm-4.4.2/configure.ac
===================================================================
--- rpm-4.4.2.orig/configure.ac
+++ rpm-4.4.2/configure.ac
@@ -222,6 +222,7 @@ AC_PATH_PROG(__GREP, grep, /bin/grep, $M
 AC_PATH_PROG(GZIPBIN, gzip, /bin/gzip, $MYPATH)
 AC_PATH_PROG(UNZIPBIN, unzip, /usr/bin/unzip, $MYPATH)
 AC_PATH_PROG(LZMABIN, lzma, /usr/bin/lzma, $MYPATH)
+AC_PATH_PROG([LZIPBIN], [lzip], [/usr/bin/lzip], [$MYPATH])
 
 AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
 AC_MSG_CHECKING(checking whether id supports -u)
Index: rpm-4.4.2/file/src/compress.c
===================================================================
--- rpm-4.4.2.orig/file/src/compress.c
+++ rpm-4.4.2/file/src/compress.c
@@ -64,6 +64,7 @@ private struct {
        const char *const argv[3];
        int silent;
 } compr[] = {
+       { "LZIP",     4, { "lzma", "-cdq", NULL }, 1 },
        { "\037\235", 2, { "gzip", "-cdq", NULL }, 1 },         /* compressed */
        /* Uncompress can get stuck; so use gzip first if we have it
         * Idea from Damien Clark, thanks! */
Index: rpm-4.4.2/macros.in
===================================================================
--- rpm-4.4.2.orig/macros.in
+++ rpm-4.4.2/macros.in
@@ -49,6 +49,7 @@
 %__install             @__INSTALL@
 %__ln_s                        @LN_S@
 %__lzma                        @LZMABIN@
+%__lzip                        @LZIPBIN@
 %__make                        @__MAKE@
 %__mkdir               @__MKDIR@
 %__mkdir_p             @MKDIR_P@
Index: rpm-4.4.2/rpmio/macro.c
===================================================================
--- rpm-4.4.2.orig/rpmio/macro.c
+++ rpm-4.4.2/rpmio/macro.c
@@ -1159,6 +1159,9 @@ doFoo(MacroBuf mb, int negate, const cha
        case 1: /* COMPRESSED_OTHER */
            sprintf(be, "%%_gzip -dc %s", b);
            break;
+       case 5: /* COMPRESSED_LZIP */
+           snprintf(be, "%%_lzip %s", b);
+           break;
        case 2: /* COMPRESSED_BZIP2 */
            sprintf(be, "%%_bzip2 %s", b);
            break;
@@ -2073,6 +2076,9 @@ int isCompressed(const char * file, rpmC
 
     rc = 0;
 
+    if (magic[0] == 'L' && magic[1] == 'Z' && magic[2] == 'I' && magic[3] == 
'P')
+        *compressed = COMPRESSED_LZIP;
+    else
     if ((magic[0] == 'B') && (magic[1] == 'Z')) {
        *compressed = COMPRESSED_BZIP2;
     } else if ((magic[0] == 0120) && (magic[1] == 0113) &&
Index: rpm-4.4.2/rpmio/rpmmacro.h
===================================================================
--- rpm-4.4.2.orig/rpmio/rpmmacro.h
+++ rpm-4.4.2/rpmio/rpmmacro.h
@@ -171,6 +171,7 @@ void        rpmFreeMacros   (/address@hidden@*/ MacroCont
 typedef enum rpmCompressedMagic_e {
     COMPRESSED_NOT             = 0,    /*!< not compressed */
     COMPRESSED_OTHER           = 1,    /*!< gzip can handle */
+    COMPRESSED_LZIP            = 5,
     COMPRESSED_BZIP2           = 2,    /*!< bzip2 can handle */
     COMPRESSED_ZIP             = 3,    /*!< unzip can handle */
     COMPRESSED_LZMA            = 4     /*!< lzma can handle */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]