From 42a52ad10bbb75cd46572f6e7de6c398bd437f27 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Tue, 29 Jul 2014 18:20:56 +0000 Subject: [PATCH] - backported xz compression (not payload) --- rpm-xz.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ rpm.spec | 4 ++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 rpm-xz.patch diff --git a/rpm-xz.patch b/rpm-xz.patch new file mode 100644 index 0000000..b94af11 --- /dev/null +++ b/rpm-xz.patch @@ -0,0 +1,69 @@ +diff -ur rpm-4.5.orig/build/parsePrep.c rpm-4.5/build/parsePrep.c +--- rpm-4.5.orig/build/parsePrep.c 2014-07-29 17:12:39.000000000 +0000 ++++ rpm-4.5/build/parsePrep.c 2014-07-29 17:14:38.749000000 +0000 +@@ -148,6 +148,9 @@ + case COMPRESSED_LZMA: + zipper = "%{__lzma}"; + break; ++ case COMPRESSED_XZ: ++ zipper = "%{__xz}"; ++ break; + } + zipper = rpmGetPath(zipper, NULL); + +@@ -251,6 +254,9 @@ + case COMPRESSED_LZMA: + t = "%{__lzma} -dc"; + break; ++ case COMPRESSED_XZ: ++ t = "%{__xz} -dc"; ++ break; + case COMPRESSED_ZIP: + if (rpmIsVerbose() && !quietly) + t = "%{__unzip}"; +diff -ur rpm-4.5.orig/rpmio/macro.c rpm-4.5/rpmio/macro.c +--- rpm-4.5.orig/rpmio/macro.c 2014-07-29 17:12:39.000000000 +0000 ++++ rpm-4.5/rpmio/macro.c 2014-07-29 17:13:17.613000000 +0000 +@@ -1241,10 +1241,13 @@ + sprintf(be, "%%__unzip -qq %s", b); + break; + case 4: /* COMPRESSED_LZOP */ +- sprintf(be, "%%__lzop %s", b); ++ sprintf(be, "%%__lzop -dc %s", b); + break; + case 5: /* COMPRESSED_LZMA */ +- sprintf(be, "%%__lzma %s", b); ++ sprintf(be, "%%__lzma -dc %s", b); ++ break; ++ case 6: /* COMPRESSED_XZ */ ++ sprintf(be, "%%__xz -dc %s", b); + break; + } + b = be; +@@ -2257,6 +2260,13 @@ + magic[11] == 0x00 && magic[12] == 0x00) /* lzmash */ + *compressed = COMPRESSED_LZMA; + else ++ if (magic[0] == 0135 && magic[1] == 0 && magic[2] == 0) /* lzma */ ++ *compressed = COMPRESSED_LZMA; ++ else ++ if (magic[0] == 0xFD && magic[1] == 0x37 && magic[2] == 0x7A ++ && magic[3] == 0x58 && magic[4] == 0x5A && magic[5] == 0x00) /* xz */ ++ *compressed = COMPRESSED_XZ; ++ 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 -ur rpm-4.5.orig/rpmio/rpmmacro.h rpm-4.5/rpmio/rpmmacro.h +--- rpm-4.5.orig/rpmio/rpmmacro.h 2014-07-29 17:12:39.000000000 +0000 ++++ rpm-4.5/rpmio/rpmmacro.h 2014-07-29 17:13:17.613000000 +0000 +@@ -170,7 +170,8 @@ + COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */ + COMPRESSED_ZIP = 3, /*!< unzip can handle */ + COMPRESSED_LZOP = 4, /*!< lzop can handle */ +- COMPRESSED_LZMA = 5 /*!< lzma can handle */ ++ COMPRESSED_LZMA = 5, /*!< lzma can handle */ ++ COMPRESSED_XZ = 6 /*!< xz can handle */ + } rpmCompressedMagic; + + /** diff --git a/rpm.spec b/rpm.spec index 5fa200d..83b3a77 100644 --- a/rpm.spec +++ b/rpm.spec @@ -42,7 +42,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM Summary(uk.UTF-8): Менеджер пакетів від RPM Name: rpm Version: 4.5 -Release: 74 +Release: 75 License: LGPL Group: Base Source0: %{name}-%{version}.tar.gz @@ -167,6 +167,7 @@ Patch106: %{name}-automake_1.12.patch Patch107: %{name}-debugedit-dwarf4.patch Patch108: %{name}-changelog_order_check_nonfatal.patch Patch109: %{name}-installplatform.patch +Patch110: %{name}-xz.patch URL: http://rpm5.org/ BuildRequires: autoconf >= 2.57 BuildRequires: automake >= 1.4 @@ -785,6 +786,7 @@ install %{SOURCE13} scripts/perl.prov %patch107 -p1 %patch108 -p1 %patch109 -p1 +%patch110 -p1 mv -f po/{sr,sr@Latn}.po rm -rf sqlite zlib popt -- 2.46.0