diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-01-12 19:46:09 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-01-12 19:46:09 +0000 |
commit | c616be110c74af0ea8ca1a3b680d19bec71611bf (patch) | |
tree | 828666335bc6e645217a4316762c5c6871f636d7 | |
parent | media-gfx/shotwell: Add support for gst-1.0; add myself as maintainer (diff) | |
download | gentoo-2-c616be110c74af0ea8ca1a3b680d19bec71611bf.tar.gz gentoo-2-c616be110c74af0ea8ca1a3b680d19bec71611bf.tar.bz2 gentoo-2-c616be110c74af0ea8ca1a3b680d19bec71611bf.zip |
app-arch/lbzip2: Backport fix from upstream git for Assertion failure, #436382
(Portage version: 2.2.0_alpha151/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)
-rw-r--r-- | app-arch/lbzip2/ChangeLog | 10 | ||||
-rw-r--r-- | app-arch/lbzip2/files/lbzip2-2.2-assertion.patch | 107 | ||||
-rw-r--r-- | app-arch/lbzip2/lbzip2-2.2-r1.ebuild | 38 | ||||
-rw-r--r-- | app-arch/lbzip2/metadata.xml | 16 |
4 files changed, 161 insertions, 10 deletions
diff --git a/app-arch/lbzip2/ChangeLog b/app-arch/lbzip2/ChangeLog index 671a03b6090a..701029510612 100644 --- a/app-arch/lbzip2/ChangeLog +++ b/app-arch/lbzip2/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-arch/lbzip2 -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/lbzip2/ChangeLog,v 1.40 2012/10/07 11:55:08 jlec Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/lbzip2/ChangeLog,v 1.41 2013/01/12 19:46:09 jlec Exp $ + +*lbzip2-2.2-r1 (12 Jan 2013) + + 12 Jan 2013; Justin Lecher <jlec@gentoo.org> +lbzip2-2.2-r1.ebuild, + +files/lbzip2-2.2-assertion.patch, metadata.xml: + Backport fix from upstream git for Assertion failure, #436382 07 Oct 2012; Justin Lecher <jlec@gentoo.org> -lbzip2-0.23-r2.ebuild, -lbzip2-2.1.ebuild, -lbzip2-2.1-r2.ebuild, lbzip2-2.2.ebuild: diff --git a/app-arch/lbzip2/files/lbzip2-2.2-assertion.patch b/app-arch/lbzip2/files/lbzip2-2.2-assertion.patch new file mode 100644 index 000000000000..b4946175b947 --- /dev/null +++ b/app-arch/lbzip2/files/lbzip2-2.2-assertion.patch @@ -0,0 +1,107 @@ +From 57eeee36927f8a40ece1ca06c674e0bd56d0f21f Mon Sep 17 00:00:00 2001 +Message-Id: <57eeee36927f8a40ece1ca06c674e0bd56d0f21f.1358019732.git.jlec@gentoo.org> +From: Mikolaj Izdebski <zurgunt@gmail.com> +Date: Sat, 20 Oct 2012 18:37:17 +0200 +Subject: [PATCH] Fix assertion failure, closes #8 + +src/encode.c (generate_initial_trees): Rewrite from scratch. +--- + src/encode.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 48 insertions(+), 13 deletions(-) + +diff --git a/src/encode.c b/src/encode.c +index 09cfacc..00a78dc 100644 +--- a/src/encode.c ++++ b/src/encode.c +@@ -763,40 +763,75 @@ assign_codes(uint32_t C[], uint32_t L[], uint8_t B[], uint32_t n) + + /* Create initial mapping of symbols to trees. + +- The goal is to divide all as symbols [0,as) into nt equivalence classes ++ The goal is to divide all as symbols [0,as) into nt equivalence classes (EC) + [0,nt) such that standard deviation of symbol frequencies in classes is + minimal. We use a kind of a heuristic to achieve that. There might exist a + better way to achieve that, but this one seems to be good (and fast) enough. + + If the symbol v belongs to the equivalence class t then set s->length[t][v] + to zero. Otherwise set it to 1. +- +- TODO: This piece of code really needs some R&D... + */ + static void + generate_initial_trees(struct encoder_state *s, unsigned nm, unsigned nt) + { +- unsigned a, b, c, t; +- +- /* Equivalence classes are empty. */ ++ unsigned a, b; /* range [a,b) of symbols forming current EC */ ++ unsigned freq; /* symbol frequency */ ++ unsigned cum; /* cumulative frequency */ ++ unsigned as; /* effective alphabet size (alphabet size minus number ++ of symbols with frequency equal to zero) */ ++ unsigned t; /* current tree */ ++ ++ /* Equivalence classes are initially empty. */ + memset(s->length, 1, sizeof(s->length)); + ++ /* Determine effective alphabet size. */ ++ as = 0; ++ for (a = 0, cum = 0; cum < nm; a++) { ++ freq = s->lookup[0][a]; ++ cum += freq; ++ as += min(freq, 1); ++ } ++ assert(cum == nm); ++ ++ /* Bound number of EC by number of symbols. Each EC is non-empty, so number ++ of symbol EC must be <= number of symbols. */ ++ nt = min(nt, as); ++ + /* For each equivalence class: */ +- for (a = 0, t = 0; t < nt; t++) { ++ a = 0; ++ for (t = 0; nt > 0; t++, nt--) { ++ assert(nm > 0); ++ assert(as >= nt); ++ + /* Find a range of symbols which total count is roughly proportional to one + nt-th of all values. */ +- for (c = 0, b = a; c * (nt-t) < nm; b++) +- c += s->lookup[0][b]; +- assert(a < b); +- if (a < b-1 && (2*c - s->lookup[0][b-1]) * (nt-t) > 2*nm) { +- c -= s->lookup[0][--b]; ++ freq = s->lookup[0][a]; ++ cum = freq; ++ as -= min(freq, 1); ++ b = a+1; ++ while (as > nt-1 && cum * nt < nm) { ++ freq = s->lookup[0][b]; ++ cum += freq; ++ as -= min(freq, 1); ++ b++; + } +- nm -= c; ++ if (cum > freq && (2*cum - freq) * nt > 2*nm) { ++ cum -= freq; ++ as += min(freq, 1); ++ b--; ++ } ++ assert(a < b); ++ assert(cum > 0); ++ assert(cum <= nm); ++ assert(as >= nt-1); ++ Trace(("Tree %u: EC=[%3u,%3u), |EC|=%3u, cum=%6u", t, a, b, b-a, cum)); + + /* Now [a,b) is our range -- assign it to equivalence class t. */ + bzero(&s->length[t][a], b - a); + a = b; ++ nm -= cum; + } ++ assert(as == 0); + assert(nm == 0); + } + +-- +1.8.1 + diff --git a/app-arch/lbzip2/lbzip2-2.2-r1.ebuild b/app-arch/lbzip2/lbzip2-2.2-r1.ebuild new file mode 100644 index 000000000000..766fa4061e69 --- /dev/null +++ b/app-arch/lbzip2/lbzip2-2.2-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/lbzip2/lbzip2-2.2-r1.ebuild,v 1.1 2013/01/12 19:46:09 jlec Exp $ + +EAPI=4 + +inherit autotools-utils + +DESCRIPTION="Parallel bzip2 utility" +HOMEPAGE="https://github.com/kjn/lbzip2/" +SRC_URI="mirror://github/kjn/${PN}/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="debug symlink" + +PATCHES=( + "${FILESDIR}"/${P}-s_isreg.patch + "${FILESDIR}"/${P}-assertion.patch + ) + +RDEPEND="symlink? ( !app-arch/pbzip2[symlink] )" +DEPEND="" + +src_configure() { + local myeconfargs=( + --disable-silent-rules + $(use_enable debug tracing) + ) + autotools-utils_src_configure +} + +src_install() { + autotools-utils_src_install + + use symlink && dosym ${PN} /usr/bin/bzip2 +} diff --git a/app-arch/lbzip2/metadata.xml b/app-arch/lbzip2/metadata.xml index bf9b027e4bde..c53572127eee 100644 --- a/app-arch/lbzip2/metadata.xml +++ b/app-arch/lbzip2/metadata.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <maintainer> - <email>jlec@gentoo.org</email> - </maintainer> - <maintainer> - <email>mattst88@gentoo.org</email> - <name>Matt Turner</name> - </maintainer> - <longdescription lang="en"> + <maintainer> + <email>jlec@gentoo.org</email> + </maintainer> + <maintainer> + <email>mattst88@gentoo.org</email> + <name>Matt Turner</name> + </maintainer> + <longdescription lang="en"> A multi-threaded bzip2/bunzip2 utility that employs multiple threads and an input-bound splitter even when decompressing .bz2 files created by standard bzip2 |