diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-04-24 15:56:11 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-04-29 08:48:56 +0300 |
commit | bcad08867d9c9550d80f9ca8ba42c4e27d3c493b (patch) | |
tree | 1e99338e9d6283b66ff46c8d026602dd32bd9cdc | |
parent | fe8d88872bc7109a8cc1b75bc8e4689ed2135bf4 (diff) | |
download | librpm-tizen-bcad08867d9c9550d80f9ca8ba42c4e27d3c493b.tar.gz librpm-tizen-bcad08867d9c9550d80f9ca8ba42c4e27d3c493b.tar.bz2 librpm-tizen-bcad08867d9c9550d80f9ca8ba42c4e27d3c493b.zip |
Add lzip support.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
-rw-r--r-- | build/parsePrep.c | 3 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | macros.in | 1 | ||||
-rw-r--r-- | rpmio/macro.c | 3 | ||||
-rw-r--r-- | rpmio/rpmfileutil.c | 3 | ||||
-rw-r--r-- | rpmio/rpmfileutil.h | 3 |
6 files changed, 13 insertions, 1 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index de2b2a00a..35d54b497 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -188,6 +188,9 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) case COMPRESSED_XZ: t = "%{__xz} -dc"; break; + case COMPRESSED_LZIP: + t = "%{__lzip} -dc"; + break; } zipper = rpmGetPath(t, NULL); if (needtar) { diff --git a/configure.ac b/configure.ac index 13c972d36..2f3e5fe3e 100644 --- a/configure.ac +++ b/configure.ac @@ -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(__LZIP, lzip, /usr/bin/lzip, $MYPATH) AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH) AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH) AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) @@ -47,6 +47,7 @@ %__id_u %{__id} -u %__install @__INSTALL@ %__ln_s @LN_S@ +%__lzip @__LZIP@ # Deprecated, use %__xz instead. %__lzma %__xz --format=lzma %__xz @__XZ@ diff --git a/rpmio/macro.c b/rpmio/macro.c index 98830d28a..9444283eb 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -959,6 +959,9 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn, case COMPRESSED_XZ: sprintf(be, "%%__xz -dc %s", b); break; + case COMPRESSED_LZIP: + sprintf(be, "%%__lzip -dc %s", b); + break; } b = be; } else if (STREQ("getenv", f, fn)) { diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c index f44eb35e3..60fe292e8 100644 --- a/rpmio/rpmfileutil.c +++ b/rpmio/rpmfileutil.c @@ -369,6 +369,9 @@ int rpmFileIsCompressed(const char * file, rpmCompressedMagic * compressed) (magic[4] == 0x5a) && (magic[5] == 0x00)) { /* new style xz (lzma) with magic */ *compressed = COMPRESSED_XZ; + } else if ((magic[0] == 'L') && (magic[1] == 'Z') && + (magic[2] == 'I') && (magic[3] == 'P')) { + *compressed = COMPRESSED_LZIP; } else if (((magic[0] == 0037) && (magic[1] == 0213)) || /* gzip */ ((magic[0] == 0037) && (magic[1] == 0236)) || /* old gzip */ ((magic[0] == 0037) && (magic[1] == 0036)) || /* pack */ diff --git a/rpmio/rpmfileutil.h b/rpmio/rpmfileutil.h index 496d7fda0..c6714151e 100644 --- a/rpmio/rpmfileutil.h +++ b/rpmio/rpmfileutil.h @@ -23,7 +23,8 @@ typedef enum rpmCompressedMagic_e { COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */ COMPRESSED_ZIP = 3, /*!< unzip can handle */ COMPRESSED_LZMA = 4, /*!< lzma can handle */ - COMPRESSED_XZ = 5 /*!< xz can handle */ + COMPRESSED_XZ = 5, /*!< xz can handle */ + COMPRESSED_LZIP = 6 /*!< lzip can handle */ } rpmCompressedMagic; /** \ingroup rpmfileutil |