summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-05-16 03:31:11 +0000
committerMike Frysinger <vapier@gentoo.org>2011-05-16 03:31:11 +0000
commit293f0ee4149906700bdfdac38e58db0e1f9e1031 (patch)
tree490a739857d56788a5b61ce0638d043f37113719 /app-arch
parentold (diff)
downloadgentoo-2-293f0ee4149906700bdfdac38e58db0e1f9e1031.tar.gz
gentoo-2-293f0ee4149906700bdfdac38e58db0e1f9e1031.tar.bz2
gentoo-2-293f0ee4149906700bdfdac38e58db0e1f9e1031.zip
Update progress patch by Justin Binns for LFS #365639 by Christopher Head.
(Portage version: 2.2.0_alpha32/cvs/Linux x86_64)
Diffstat (limited to 'app-arch')
-rw-r--r--app-arch/bzip2/ChangeLog10
-rw-r--r--app-arch/bzip2/bzip2-1.0.6-r2.ebuild73
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-progress.patch163
3 files changed, 244 insertions, 2 deletions
diff --git a/app-arch/bzip2/ChangeLog b/app-arch/bzip2/ChangeLog
index 2521368a3e06..b5f239bf9d39 100644
--- a/app-arch/bzip2/ChangeLog
+++ b/app-arch/bzip2/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-arch/bzip2
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.85 2010/10/09 16:30:07 armin76 Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.86 2011/05/16 03:31:10 vapier Exp $
+
+*bzip2-1.0.6-r2 (16 May 2011)
+
+ 16 May 2011; Mike Frysinger <vapier@gentoo.org> +bzip2-1.0.6-r2.ebuild,
+ +files/bzip2-1.0.6-progress.patch:
+ Update progress patch by Justin Binns for LFS #365639 by Christopher Head.
09 Oct 2010; Raúl Porcel <armin76@gentoo.org> bzip2-1.0.6.ebuild:
ia64/m68k/s390/sh/sparc stable wrt #338215
diff --git a/app-arch/bzip2/bzip2-1.0.6-r2.ebuild b/app-arch/bzip2/bzip2-1.0.6-r2.ebuild
new file mode 100644
index 000000000000..3843b3be4b5c
--- /dev/null
+++ b/app-arch/bzip2/bzip2-1.0.6-r2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/bzip2-1.0.6-r2.ebuild,v 1.1 2011/05/16 03:31:11 vapier Exp $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs flag-o-matic
+
+DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
+HOMEPAGE="http://www.bzip.org/"
+SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
+
+LICENSE="BZIP2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="static"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
+ epatch "${FILESDIR}"/${PN}-1.0.6-saneso.patch
+ epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
+ epatch "${FILESDIR}"/${PN}-1.0.6-progress.patch
+ epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
+ epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
+
+ # - Use right man path
+ # - Generate symlinks instead of hardlinks
+ # - pass custom variables to control libdir
+ sed -i \
+ -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
+ -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
+ -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
+ Makefile || die
+}
+
+bemake() {
+ emake \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ RANLIB="$(tc-getRANLIB)" \
+ "$@" || die
+}
+src_compile() {
+ bemake -f Makefile-libbz2_so all || die
+ use static && append-flags -static
+ bemake all || die
+}
+
+src_install() {
+ emake PREFIX="${D}"/usr LIBDIR=$(get_libdir) install || die
+ dodoc README* CHANGES bzip2.txt manual.*
+
+ # Install the shared lib manually. We install:
+ # .x.x.x - standard shared lib behavior
+ # .x.x - SONAME some distros use #338321
+ # .x - SONAME Gentoo uses
+ dolib.so libbz2.so.${PV} || die
+ local s
+ for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
+ dosym libbz2.so.${PV} /usr/$(get_libdir)/${v} || die
+ done
+ gen_usr_ldscript -a bz2
+
+ if ! use static ; then
+ newbin bzip2-shared bzip2 || die
+ fi
+
+ # move "important" bzip2 binaries to /bin and use the shared libbz2.so
+ dodir /bin
+ mv "${D}"/usr/bin/b{zip2,zcat,unzip2} "${D}"/bin/ || die
+ dosym bzip2 /bin/bzcat || die
+ dosym bzip2 /bin/bunzip2 || die
+}
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-progress.patch b/app-arch/bzip2/files/bzip2-1.0.6-progress.patch
new file mode 100644
index 000000000000..7691d63e27c8
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-progress.patch
@@ -0,0 +1,163 @@
+Ripped from Mandrake
+
+http://bugs.gentoo.org/82192
+
+--- bzip2-1.0.6/bzip2.1
++++ bzip2-1.0.6/bzip2.1
+@@ -235,6 +235,10 @@
+ Suppress non-essential warning messages. Messages pertaining to
+ I/O errors and other critical events will not be suppressed.
+ .TP
++.B \-p \-\-show\-progress
++Show percentage of input\-file done and while compressing show the percentage
++of the original file the new file is.
++.TP
+ .B \-v --verbose
+ Verbose mode -- show the compression ratio for each file processed.
+ Further \-v's increase the verbosity level, spewing out lots of
+--- bzip2-1.0.6/bzip2.c
++++ bzip2-1.0.6/bzip2.c
+@@ -145,6 +145,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <errno.h>
++#include <time.h>
+ #include <ctype.h>
+ #include "bzlib.h"
+
+@@ -301,6 +302,7 @@
+ Char progNameReally[FILE_NAME_LEN];
+ FILE *outputHandleJustInCase;
+ Int32 workFactor;
++Char showProgress;
+
+ static void panic ( Char* ) NORETURN;
+ static void ioError ( void ) NORETURN;
+@@ -425,6 +427,12 @@
+ UInt32 nbytes_in_lo32, nbytes_in_hi32;
+ UInt32 nbytes_out_lo32, nbytes_out_hi32;
+ Int32 bzerr, bzerr_dummy, ret;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ /* double because big files might otherwhise give
++ * overflows. not long long since not all compilers
++ * support that one
++ */
++ time_t startTime, currentTime;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+@@ -432,12 +440,21 @@
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ (void)fseek(stream, 0, SEEK_END);
++ fileSize = ftello(stream);
++ rewind(stream);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
+ blockSize100k, verbosity, workFactor );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n" );
+
++ time(&startTime);
+ while (True) {
+
+ if (myfeof(stream)) break;
+@@ -446,6 +463,22 @@
+ if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
+ if (bzerr != BZ_OK) goto errhandler;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++
++ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
++ double curInPos = ftello(stream);
++ double curOutPos = ftello(zStream);
++
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
++ if (srcMode == SM_F2F)
++ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
++
++ fprintf(stderr, " \r");
++ }
++ }
+ }
+
+ BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
+@@ -526,6 +559,8 @@
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ UChar* unusedTmp;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ time_t startTime, currentTime;
+
+ nUnused = 0;
+ streamNo = 0;
+@@ -533,9 +568,19 @@
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ off_t dummy = ftello(zStream);
++ (void)fseeko(zStream, 0, SEEK_END);
++ fileSize = ftello(zStream);
++ (void)fseeko(zStream, dummy, SEEK_SET);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ time(&startTime);
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+@@ -551,6 +596,16 @@
+ if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
+ fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
++
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++ if ((currentTime - startTime) >= 2) {
++ double curInPos = ftello(zStream);
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
++ }
++ }
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+@@ -1872,6 +1927,7 @@
+ deleteOutputOnInterrupt = False;
+ exitValue = 0;
+ i = j = 0; /* avoid bogus warning from egcs-1.1.X */
++ showProgress = False;
+
+ /*-- Set up signal handlers for mem access errors --*/
+ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
+@@ -1949,6 +2005,7 @@
+ case 'k': keepInputFiles = True; break;
+ case 's': smallMode = True; break;
+ case 'q': noisy = False; break;
++ case 'p': showProgress = True; break;
+ case '1': blockSize100k = 1; break;
+ case '2': blockSize100k = 2; break;
+ case '3': blockSize100k = 3; break;
+@@ -1985,6 +2042,7 @@
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
++ if (ISFLAG("--show-progress")) showProgress = True; else
+ if (ISFLAG("--version")) license(); else
+ if (ISFLAG("--license")) license(); else
+ if (ISFLAG("--exponential")) workFactor = 1; else