diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-02-19 18:30:39 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-02-19 18:30:39 +0000 |
commit | c4c9fb2a638fea6f430054d0d06e43ab68529564 (patch) | |
tree | 148f0776bd212447beee33da5c9c2907344a06f3 /app-arch/bzip2 | |
parent | Stable on ppc (diff) | |
download | gentoo-2-c4c9fb2a638fea6f430054d0d06e43ab68529564.tar.gz gentoo-2-c4c9fb2a638fea6f430054d0d06e43ab68529564.tar.bz2 gentoo-2-c4c9fb2a638fea6f430054d0d06e43ab68529564.zip |
Add progress patch from Mandrake #82192 by Adam.
(Portage version: 2.0.51-r15)
Diffstat (limited to 'app-arch/bzip2')
-rw-r--r-- | app-arch/bzip2/ChangeLog | 8 | ||||
-rw-r--r-- | app-arch/bzip2/bzip2-1.0.2-r5.ebuild | 80 | ||||
-rw-r--r-- | app-arch/bzip2/files/bzip2-1.0.2-progress.patch | 175 | ||||
-rw-r--r-- | app-arch/bzip2/files/digest-bzip2-1.0.2-r5 | 1 |
4 files changed, 263 insertions, 1 deletions
diff --git a/app-arch/bzip2/ChangeLog b/app-arch/bzip2/ChangeLog index 0e17d9466e08..5c83b6f4d1dd 100644 --- a/app-arch/bzip2/ChangeLog +++ b/app-arch/bzip2/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-arch/bzip2 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.19 2005/02/11 23:04:37 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/ChangeLog,v 1.20 2005/02/19 18:30:39 vapier Exp $ + +*bzip2-1.0.2-r5 (19 Feb 2005) + + 19 Feb 2005; Mike Frysinger <vapier@gentoo.org> + +files/bzip2-1.0.2-progress.patch, +bzip2-1.0.2-r5.ebuild: + Add progress patch from Mandrake #82192 by Adam. 11 Feb 2005; Mike Frysinger <vapier@gentoo.org> +files/bzip2-1.0.2-saneso.patch, bzip2-1.0.2-r4.ebuild: diff --git a/app-arch/bzip2/bzip2-1.0.2-r5.ebuild b/app-arch/bzip2/bzip2-1.0.2-r5.ebuild new file mode 100644 index 000000000000..2a44e0d0b0d3 --- /dev/null +++ b/app-arch/bzip2/bzip2-1.0.2-r5.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/bzip2/bzip2-1.0.2-r5.ebuild,v 1.1 2005/02/19 18:30:39 vapier Exp $ + +inherit toolchain-funcs flag-o-matic + +DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux" +HOMEPAGE="http://sources.redhat.com/bzip2/" +SRC_URI="ftp://sources.redhat.com/pub/bzip2/v102/${P}.tar.gz" + +LICENSE="BZIP2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc x86" +IUSE="build static" + +DEPEND="virtual/libc" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-NULL-ptr-check.patch + epatch "${FILESDIR}"/${P}-makefile-CFLAGS.patch + epatch "${FILESDIR}"/${P}-saneso.patch + epatch "${FILESDIR}"/${P}-progress.patch + sed -i -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' Makefile || die + + use static && append-flags -static + + # bzip2 will to run itself after it has built itself which we + # can't do if we are cross compiling. -solar + if [[ -x /bin/bzip2 ]] && tc-is-cross-compiler ; then + sed -i -e 's:./bzip2 -:bzip2 -:g' Makefile || die + fi +} + +src_compile() { + local makeopts=" + CC=$(tc-getCC) + AR=$(tc-getAR) + RANLIB=$(tc-getRANLIB) + " + if ! use build ; then + emake ${makeopts} -f Makefile-libbz2_so all || die "Make failed libbz2" + fi + emake ${makeopts} all || die "Make failed" +} + +src_install() { + if ! use build ; then + make PREFIX="${D}"/usr install || die + mv "${D}"/usr/bin "${D}" + + # These are symlinks to bzip2 ... + for x in bunzip2 bzcat ; do + if [[ -f ${D}/bin/${x} ]] ; then + rm -f ${D}/bin/${x} + dosym bzip2 /bin/${x} + fi + done + + [[ -z ${CONF_LIBDIR} ]] && CONF_LIBDIR="lib" + [[ ${CONF_LIBDIR} != "lib" ]] && mv ${D}/usr/lib ${D}/usr/${CONF_LIBDIR} + dolib.so "${S}"/libbz2.so.${PV} + dosym libbz2.so.${PV} /usr/${CONF_LIBDIR}/libbz2.so.1.0 + dosym libbz2.so.${PV} /usr/${CONF_LIBDIR}/libbz2.so + dosym libbz2.so.${PV} /usr/${CONF_LIBDIR}/libbz2.so.1 + + dodoc README CHANGES Y2K_INFO + docinto txt + dodoc *.txt + docinto ps + dodoc *.ps + dohtml manual_*.html + else + into / + dobin bzip2 + dosym bzip2 /bin/bzcat + dosym bzip2 /bin/bunzip2 + fi +} diff --git a/app-arch/bzip2/files/bzip2-1.0.2-progress.patch b/app-arch/bzip2/files/bzip2-1.0.2-progress.patch new file mode 100644 index 000000000000..2f389cfac982 --- /dev/null +++ b/app-arch/bzip2/files/bzip2-1.0.2-progress.patch @@ -0,0 +1,175 @@ +Ripped from Mandrake. + +http://bugs.gentoo.org/show_bug.cgi?id=82192 + +--- bzip2-1.0.2.org/bzip2.1 ++++ bzip2-1.0.2/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.2.org/bzip2.c ++++ bzip2-1.0.2/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 = (double)ftell(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,13 +463,32 @@ + 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(¤tTime); ++ ++ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */ ++ double curInPos = (double)ftell(stream); ++ double curOutPos = (double)ftell(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, + &nbytes_in_lo32, &nbytes_in_hi32, + &nbytes_out_lo32, &nbytes_out_hi32 ); + if (bzerr != BZ_OK) goto errhandler; +- ++ + if (ferror(zStream)) goto errhandler_io; + ret = fflush ( zStream ); + if (ret == EOF) goto errhandler_io; +@@ -526,6 +562,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 +571,19 @@ + SET_BINARY_MODE(stream); + SET_BINARY_MODE(zStream); + ++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) { ++ long dummy = ftell(zStream); ++ (void)fseek(zStream, 0, SEEK_END); ++ fileSize = (double)ftell(zStream); ++ (void)fseek(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 +599,17 @@ + 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(¤tTime); ++ if ((currentTime - startTime) >= 2) ++ { ++ double curInPos = (double)ftell(zStream); ++ startTime = currentTime; ++ ++ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize); ++ } ++ } + } + if (bzerr != BZ_STREAM_END) goto errhandler; + +@@ -1872,6 +1931,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 +2009,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 +2046,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 diff --git a/app-arch/bzip2/files/digest-bzip2-1.0.2-r5 b/app-arch/bzip2/files/digest-bzip2-1.0.2-r5 new file mode 100644 index 000000000000..5b1f375c39ee --- /dev/null +++ b/app-arch/bzip2/files/digest-bzip2-1.0.2-r5 @@ -0,0 +1 @@ +MD5 ee76864958d568677f03db8afad92beb bzip2-1.0.2.tar.gz 665198 |