Add lrzip support.
authorVille Skyttä <ville.skytta@iki.fi>
Sun, 24 Apr 2011 12:57:23 +0000 (15:57 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 29 Apr 2011 05:49:05 +0000 (08:49 +0300)
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
build/parsePrep.c
configure.ac
macros.in
rpmio/macro.c
rpmio/rpmfileutil.c
rpmio/rpmfileutil.h

index 35d54b4..c0508ec 100644 (file)
@@ -191,6 +191,9 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly)
        case COMPRESSED_LZIP:
            t = "%{__lzip} -dc";
            break;
+       case COMPRESSED_LRZIP:
+           t = "%{__lrzip} -dqo-";
+           break;
        }
        zipper = rpmGetPath(t, NULL);
        if (needtar) {
index 2f3e5fe..64c5509 100644 (file)
@@ -106,6 +106,7 @@ AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH)
 AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH)
 AC_PATH_PROG(__ID, id, /usr/bin/id, $MYPATH)
 AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH)
+AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH)
 AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH)
 AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH)
 AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH)
index e4d3997..dd5207a 100644 (file)
--- a/macros.in
+++ b/macros.in
@@ -47,6 +47,7 @@
 %__id_u                        %{__id} -u
 %__install             @__INSTALL@
 %__ln_s                        @LN_S@
+%__lrzip               @__LRZIP@
 %__lzip                        @__LZIP@
 # Deprecated, use %__xz instead.
 %__lzma                        %__xz --format=lzma
index 9444283..8ea4819 100644 (file)
@@ -962,6 +962,9 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
        case COMPRESSED_LZIP:
            sprintf(be, "%%__lzip -dc %s", b);
            break;
+       case COMPRESSED_LRZIP:
+           sprintf(be, "%%__lrzip -dqo- %s", b);
+           break;
        }
        b = be;
     } else if (STREQ("getenv", f, fn)) {
index 60fe292..6085a46 100644 (file)
@@ -372,6 +372,9 @@ int rpmFileIsCompressed(const char * file, rpmCompressedMagic * compressed)
     } else if ((magic[0] == 'L') && (magic[1] == 'Z') &&
               (magic[2] == 'I') && (magic[3] == 'P')) {
        *compressed = COMPRESSED_LZIP;
+    } else if ((magic[0] == 'L') && (magic[1] == 'R') &&
+              (magic[2] == 'Z') && (magic[3] == 'I')) {
+       *compressed = COMPRESSED_LRZIP;
     } else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */
        ((magic[0] == 0037) && (magic[1] == 0236)) ||   /* old gzip */
        ((magic[0] == 0037) && (magic[1] == 0036)) ||   /* pack */
index c671415..28c6d8a 100644 (file)
@@ -24,7 +24,8 @@ typedef enum rpmCompressedMagic_e {
     COMPRESSED_ZIP             = 3,    /*!< unzip can handle */
     COMPRESSED_LZMA            = 4,    /*!< lzma can handle */
     COMPRESSED_XZ              = 5,    /*!< xz can handle */
-    COMPRESSED_LZIP            = 6     /*!< lzip can handle */
+    COMPRESSED_LZIP            = 6,    /*!< lzip can handle */
+    COMPRESSED_LRZIP           = 7     /*!< lrzip can handle */
 } rpmCompressedMagic;
 
 /** \ingroup rpmfileutil