Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/bzip2/, app-arch/bzip2/files/
Date: Wed, 30 Mar 2016 23:48:56
Message-Id: 1459381663.86fa1657a0722f6e1179e3d6f1e94a6d6b6995fb.vapier@gentoo
1 commit: 86fa1657a0722f6e1179e3d6f1e94a6d6b6995fb
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 30 22:39:17 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 30 23:47:43 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86fa1657
7
8 app-arch/bzip2: drop old <1.0.6-r6 versions
9
10 app-arch/bzip2/bzip2-1.0.6-r1.ebuild | 73 ----------
11 app-arch/bzip2/bzip2-1.0.6-r2.ebuild | 73 ----------
12 app-arch/bzip2/bzip2-1.0.6-r3.ebuild | 80 -----------
13 app-arch/bzip2/bzip2-1.0.6-r4.ebuild | 87 ------------
14 app-arch/bzip2/bzip2-1.0.6.ebuild | 68 ---------
15 app-arch/bzip2/files/bzip2-1.0.2-progress.patch | 175 ------------------------
16 6 files changed, 556 deletions(-)
17
18 diff --git a/app-arch/bzip2/bzip2-1.0.6-r1.ebuild b/app-arch/bzip2/bzip2-1.0.6-r1.ebuild
19 deleted file mode 100644
20 index 8f48338..0000000
21 --- a/app-arch/bzip2/bzip2-1.0.6-r1.ebuild
22 +++ /dev/null
23 @@ -1,73 +0,0 @@
24 -# Copyright 1999-2010 Gentoo Foundation
25 -# Distributed under the terms of the GNU General Public License v2
26 -# $Id$
27 -
28 -inherit eutils multilib toolchain-funcs flag-o-matic
29 -
30 -DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
31 -HOMEPAGE="http://www.bzip.org/"
32 -SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
33 -
34 -LICENSE="BZIP2"
35 -SLOT="0"
36 -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
37 -IUSE="static"
38 -
39 -src_unpack() {
40 - unpack ${A}
41 - cd "${S}"
42 - epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
43 - epatch "${FILESDIR}"/${PN}-1.0.6-saneso.patch
44 - epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
45 - epatch "${FILESDIR}"/${PN}-1.0.2-progress.patch
46 - epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
47 - epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
48 -
49 - # - Use right man path
50 - # - Generate symlinks instead of hardlinks
51 - # - pass custom variables to control libdir
52 - sed -i \
53 - -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
54 - -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
55 - -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
56 - Makefile || die
57 -}
58 -
59 -bemake() {
60 - emake \
61 - CC="$(tc-getCC)" \
62 - AR="$(tc-getAR)" \
63 - RANLIB="$(tc-getRANLIB)" \
64 - "$@" || die
65 -}
66 -src_compile() {
67 - bemake -f Makefile-libbz2_so all || die
68 - use static && append-flags -static
69 - bemake all || die
70 -}
71 -
72 -src_install() {
73 - emake PREFIX="${D}"/usr LIBDIR=$(get_libdir) install || die
74 - dodoc README* CHANGES bzip2.txt manual.*
75 -
76 - # Install the shared lib manually. We install:
77 - # .x.x.x - standard shared lib behavior
78 - # .x.x - SONAME some distros use #338321
79 - # .x - SONAME Gentoo uses
80 - dolib.so libbz2.so.${PV} || die
81 - local s
82 - for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
83 - dosym libbz2.so.${PV} /usr/$(get_libdir)/${v} || die
84 - done
85 - gen_usr_ldscript -a bz2
86 -
87 - if ! use static ; then
88 - newbin bzip2-shared bzip2 || die
89 - fi
90 -
91 - # move "important" bzip2 binaries to /bin and use the shared libbz2.so
92 - dodir /bin
93 - mv "${D}"/usr/bin/b{zip2,zcat,unzip2} "${D}"/bin/ || die
94 - dosym bzip2 /bin/bzcat || die
95 - dosym bzip2 /bin/bunzip2 || die
96 -}
97
98 diff --git a/app-arch/bzip2/bzip2-1.0.6-r2.ebuild b/app-arch/bzip2/bzip2-1.0.6-r2.ebuild
99 deleted file mode 100644
100 index 734eea8..0000000
101 --- a/app-arch/bzip2/bzip2-1.0.6-r2.ebuild
102 +++ /dev/null
103 @@ -1,73 +0,0 @@
104 -# Copyright 1999-2011 Gentoo Foundation
105 -# Distributed under the terms of the GNU General Public License v2
106 -# $Id$
107 -
108 -EAPI="2"
109 -
110 -inherit eutils multilib toolchain-funcs flag-o-matic
111 -
112 -DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
113 -HOMEPAGE="http://www.bzip.org/"
114 -SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
115 -
116 -LICENSE="BZIP2"
117 -SLOT="0"
118 -KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
119 -IUSE="static"
120 -
121 -src_prepare() {
122 - epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
123 - epatch "${FILESDIR}"/${PN}-1.0.6-saneso.patch
124 - epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
125 - epatch "${FILESDIR}"/${PN}-1.0.6-progress.patch
126 - epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
127 - epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
128 -
129 - # - Use right man path
130 - # - Generate symlinks instead of hardlinks
131 - # - pass custom variables to control libdir
132 - sed -i \
133 - -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
134 - -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
135 - -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
136 - Makefile || die
137 -}
138 -
139 -bemake() {
140 - emake \
141 - CC="$(tc-getCC)" \
142 - AR="$(tc-getAR)" \
143 - RANLIB="$(tc-getRANLIB)" \
144 - "$@" || die
145 -}
146 -src_compile() {
147 - bemake -f Makefile-libbz2_so all || die
148 - use static && append-flags -static
149 - bemake all || die
150 -}
151 -
152 -src_install() {
153 - emake PREFIX="${D}"/usr LIBDIR=$(get_libdir) install || die
154 - dodoc README* CHANGES bzip2.txt manual.*
155 -
156 - # Install the shared lib manually. We install:
157 - # .x.x.x - standard shared lib behavior
158 - # .x.x - SONAME some distros use #338321
159 - # .x - SONAME Gentoo uses
160 - dolib.so libbz2.so.${PV} || die
161 - local s
162 - for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
163 - dosym libbz2.so.${PV} /usr/$(get_libdir)/${v} || die
164 - done
165 - gen_usr_ldscript -a bz2
166 -
167 - if ! use static ; then
168 - newbin bzip2-shared bzip2 || die
169 - fi
170 -
171 - # move "important" bzip2 binaries to /bin and use the shared libbz2.so
172 - dodir /bin
173 - mv "${D}"/usr/bin/b{zip2,zcat,unzip2} "${D}"/bin/ || die
174 - dosym bzip2 /bin/bzcat || die
175 - dosym bzip2 /bin/bunzip2 || die
176 -}
177
178 diff --git a/app-arch/bzip2/bzip2-1.0.6-r3.ebuild b/app-arch/bzip2/bzip2-1.0.6-r3.ebuild
179 deleted file mode 100644
180 index 8018d7a..0000000
181 --- a/app-arch/bzip2/bzip2-1.0.6-r3.ebuild
182 +++ /dev/null
183 @@ -1,80 +0,0 @@
184 -# Copyright 1999-2014 Gentoo Foundation
185 -# Distributed under the terms of the GNU General Public License v2
186 -# $Id$
187 -
188 -# XXX: atm, libbz2.a is always PIC :(, so it is always built quickly
189 -# (since we're building shared libs) ...
190 -
191 -EAPI="2"
192 -
193 -inherit eutils multilib toolchain-funcs flag-o-matic
194 -
195 -DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
196 -HOMEPAGE="http://www.bzip.org/"
197 -SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
198 -
199 -LICENSE="BZIP2"
200 -SLOT="0"
201 -KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
202 -IUSE="static static-libs"
203 -
204 -src_prepare() {
205 - epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
206 - epatch "${FILESDIR}"/${PN}-1.0.6-saneso.patch
207 - epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
208 - epatch "${FILESDIR}"/${PN}-1.0.6-progress.patch
209 - epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
210 - epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
211 - epatch "${FILESDIR}"/${PN}-1.0.6-mingw.patch #393573
212 -
213 - # - Use right man path
214 - # - Generate symlinks instead of hardlinks
215 - # - pass custom variables to control libdir
216 - sed -i \
217 - -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
218 - -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
219 - -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
220 - Makefile || die
221 -}
222 -
223 -bemake() {
224 - emake \
225 - CC="$(tc-getCC)" \
226 - AR="$(tc-getAR)" \
227 - RANLIB="$(tc-getRANLIB)" \
228 - "$@" || die
229 -}
230 -src_compile() {
231 - bemake -f Makefile-libbz2_so all || die
232 - use static && append-flags -static
233 - bemake all || die
234 -}
235 -
236 -src_install() {
237 - emake PREFIX="${D}"/usr LIBDIR=$(get_libdir) install || die
238 - dodoc README* CHANGES bzip2.txt manual.*
239 -
240 - # Install the shared lib manually. We install:
241 - # .x.x.x - standard shared lib behavior
242 - # .x.x - SONAME some distros use #338321
243 - # .x - SONAME Gentoo uses
244 - dolib.so libbz2.so.${PV} || die
245 - local s
246 - for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
247 - dosym libbz2.so.${PV} /usr/$(get_libdir)/${v} || die
248 - done
249 - gen_usr_ldscript -a bz2
250 -
251 - if ! use static ; then
252 - newbin bzip2-shared bzip2 || die
253 - fi
254 - if ! use static-libs ; then
255 - rm -f "${D}"/usr/lib*/libbz2.a || die
256 - fi
257 -
258 - # move "important" bzip2 binaries to /bin and use the shared libbz2.so
259 - dodir /bin
260 - mv "${D}"/usr/bin/b{zip2,zcat,unzip2} "${D}"/bin/ || die
261 - dosym bzip2 /bin/bzcat || die
262 - dosym bzip2 /bin/bunzip2 || die
263 -}
264
265 diff --git a/app-arch/bzip2/bzip2-1.0.6-r4.ebuild b/app-arch/bzip2/bzip2-1.0.6-r4.ebuild
266 deleted file mode 100644
267 index dd02be6..0000000
268 --- a/app-arch/bzip2/bzip2-1.0.6-r4.ebuild
269 +++ /dev/null
270 @@ -1,87 +0,0 @@
271 -# Copyright 1999-2014 Gentoo Foundation
272 -# Distributed under the terms of the GNU General Public License v2
273 -# $Id$
274 -
275 -# XXX: atm, libbz2.a is always PIC :(, so it is always built quickly
276 -# (since we're building shared libs) ...
277 -
278 -EAPI=4
279 -
280 -inherit eutils toolchain-funcs multilib multilib-minimal
281 -
282 -DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
283 -HOMEPAGE="http://www.bzip.org/"
284 -SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
285 -
286 -LICENSE="BZIP2"
287 -SLOT="0"
288 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
289 -IUSE="static static-libs"
290 -
291 -RDEPEND="abi_x86_32? (
292 - !<=app-emulation/emul-linux-x86-baselibs-20130224
293 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
294 - )"
295 -
296 -src_prepare() {
297 - epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
298 - epatch "${FILESDIR}"/${PN}-1.0.6-saneso.patch
299 - epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
300 - epatch "${FILESDIR}"/${PN}-1.0.6-progress.patch
301 - epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
302 - epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
303 - epatch "${FILESDIR}"/${PN}-1.0.6-mingw.patch #393573
304 -
305 - # - Use right man path
306 - # - Generate symlinks instead of hardlinks
307 - # - pass custom variables to control libdir
308 - sed -i \
309 - -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
310 - -e 's:ln -s -f $(PREFIX)/bin/:ln -s -f :' \
311 - -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
312 - Makefile || die
313 -
314 - multilib_copy_sources
315 -}
316 -
317 -bemake() {
318 - emake \
319 - CC="$(tc-getCC)" \
320 - AR="$(tc-getAR)" \
321 - RANLIB="$(tc-getRANLIB)" \
322 - "$@"
323 -}
324 -
325 -multilib_src_compile() {
326 - bemake -f Makefile-libbz2_so all
327 - bemake all LDFLAGS="${LDFLAGS} $(usex static -static '')"
328 -}
329 -
330 -multilib_src_install() {
331 - emake PREFIX="${ED}"/usr LIBDIR=$(get_libdir) install
332 -
333 - # Install the shared lib manually. We install:
334 - # .x.x.x - standard shared lib behavior
335 - # .x.x - SONAME some distros use #338321
336 - # .x - SONAME Gentoo uses
337 - dolib.so libbz2.so.${PV}
338 - local v
339 - for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
340 - dosym libbz2.so.${PV} /usr/$(get_libdir)/${v}
341 - done
342 - gen_usr_ldscript -a bz2
343 -
344 - use static || newbin bzip2-shared bzip2
345 -}
346 -
347 -multilib_src_install_all() {
348 - dodoc README* CHANGES bzip2.txt manual.*
349 -
350 - # move "important" bzip2 binaries to /bin and use the shared libbz2.so
351 - dodir /bin
352 - mv "${ED}"/usr/bin/b{zip2,zcat,unzip2} "${ED}"/bin/ || die
353 - dosym bzip2 /bin/bzcat
354 - dosym bzip2 /bin/bunzip2
355 -
356 - use static-libs || find "${ED}"/usr -name libbz2.a -delete
357 -}
358
359 diff --git a/app-arch/bzip2/bzip2-1.0.6.ebuild b/app-arch/bzip2/bzip2-1.0.6.ebuild
360 deleted file mode 100644
361 index fa6a127..0000000
362 --- a/app-arch/bzip2/bzip2-1.0.6.ebuild
363 +++ /dev/null
364 @@ -1,68 +0,0 @@
365 -# Copyright 1999-2010 Gentoo Foundation
366 -# Distributed under the terms of the GNU General Public License v2
367 -# $Id$
368 -
369 -inherit eutils multilib toolchain-funcs flag-o-matic
370 -
371 -DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
372 -HOMEPAGE="http://www.bzip.org/"
373 -SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
374 -
375 -LICENSE="BZIP2"
376 -SLOT="0"
377 -KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
378 -IUSE="static"
379 -
380 -src_unpack() {
381 - unpack ${A}
382 - cd "${S}"
383 - epatch "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
384 - epatch "${FILESDIR}"/${PN}-1.0.6-saneso.patch
385 - epatch "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
386 - epatch "${FILESDIR}"/${PN}-1.0.2-progress.patch
387 - epatch "${FILESDIR}"/${PN}-1.0.3-no-test.patch
388 - epatch "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
389 -
390 - # - Use right man path
391 - # - Generate symlinks instead of hardlinks
392 - # - pass custom variables to control libdir
393 - sed -i \
394 - -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
395 - -e 's:ln -s -f $(PREFIX)/bin/:ln -s :' \
396 - -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
397 - Makefile || die
398 -}
399 -
400 -bemake() {
401 - emake \
402 - CC="$(tc-getCC)" \
403 - AR="$(tc-getAR)" \
404 - RANLIB="$(tc-getRANLIB)" \
405 - "$@" || die
406 -}
407 -src_compile() {
408 - bemake -f Makefile-libbz2_so all || die
409 - use static && append-flags -static
410 - bemake all || die
411 -}
412 -
413 -src_install() {
414 - emake PREFIX="${D}"/usr LIBDIR=$(get_libdir) install || die
415 - dodoc README* CHANGES bzip2.txt manual.*
416 -
417 - # Install the shared lib manually
418 - dolib.so libbz2.so.${PV} || die
419 - dosym libbz2.so.${PV} /usr/$(get_libdir)/libbz2.so || die
420 - dosym libbz2.so.${PV} /usr/$(get_libdir)/libbz2.so.${PV%%.*} || die
421 - gen_usr_ldscript -a bz2
422 -
423 - if ! use static ; then
424 - newbin bzip2-shared bzip2 || die
425 - fi
426 -
427 - # move "important" bzip2 binaries to /bin and use the shared libbz2.so
428 - dodir /bin
429 - mv "${D}"/usr/bin/b{zip2,zcat,unzip2} "${D}"/bin/ || die
430 - dosym bzip2 /bin/bzcat || die
431 - dosym bzip2 /bin/bunzip2 || die
432 -}
433
434 diff --git a/app-arch/bzip2/files/bzip2-1.0.2-progress.patch b/app-arch/bzip2/files/bzip2-1.0.2-progress.patch
435 deleted file mode 100644
436 index 2f389cf..0000000
437 --- a/app-arch/bzip2/files/bzip2-1.0.2-progress.patch
438 +++ /dev/null
439 @@ -1,175 +0,0 @@
440 -Ripped from Mandrake.
441 -
442 -http://bugs.gentoo.org/show_bug.cgi?id=82192
443 -
444 ---- bzip2-1.0.2.org/bzip2.1
445 -+++ bzip2-1.0.2/bzip2.1
446 -@@ -235,6 +235,10 @@
447 - Suppress non-essential warning messages. Messages pertaining to
448 - I/O errors and other critical events will not be suppressed.
449 - .TP
450 -+.B \-p --show-progress
451 -+Show percentage of input-file done and while compressing show the percentage
452 -+of the original file the new file is.
453 -+.TP
454 - .B \-v --verbose
455 - Verbose mode -- show the compression ratio for each file processed.
456 - Further \-v's increase the verbosity level, spewing out lots of
457 ---- bzip2-1.0.2.org/bzip2.c
458 -+++ bzip2-1.0.2/bzip2.c
459 -@@ -145,6 +145,7 @@
460 - #include <signal.h>
461 - #include <math.h>
462 - #include <errno.h>
463 -+#include <time.h>
464 - #include <ctype.h>
465 - #include "bzlib.h"
466 -
467 -@@ -301,6 +302,7 @@
468 - Char progNameReally[FILE_NAME_LEN];
469 - FILE *outputHandleJustInCase;
470 - Int32 workFactor;
471 -+Char showProgress;
472 -
473 - static void panic ( Char* ) NORETURN;
474 - static void ioError ( void ) NORETURN;
475 -@@ -425,6 +427,12 @@
476 - UInt32 nbytes_in_lo32, nbytes_in_hi32;
477 - UInt32 nbytes_out_lo32, nbytes_out_hi32;
478 - Int32 bzerr, bzerr_dummy, ret;
479 -+ double fileSize = 0; /* initialized to make the compiler stop crying */
480 -+ /* double because big files might otherwhise give
481 -+ * overflows. not long long since not all compilers
482 -+ * support that one
483 -+ */
484 -+ time_t startTime, currentTime;
485 -
486 - SET_BINARY_MODE(stream);
487 - SET_BINARY_MODE(zStream);
488 -@@ -432,12 +440,21 @@
489 - if (ferror(stream)) goto errhandler_io;
490 - if (ferror(zStream)) goto errhandler_io;
491 -
492 -+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
493 -+ (void)fseek(stream, 0, SEEK_END);
494 -+ fileSize = (double)ftell(stream);
495 -+ rewind(stream);
496 -+ if (verbosity >= 1)
497 -+ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
498 -+ }
499 -+
500 - bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
501 - blockSize100k, verbosity, workFactor );
502 - if (bzerr != BZ_OK) goto errhandler;
503 -
504 - if (verbosity >= 2) fprintf ( stderr, "\n" );
505 -
506 -+ time(&startTime);
507 - while (True) {
508 -
509 - if (myfeof(stream)) break;
510 -@@ -446,13 +463,32 @@
511 - if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
512 - if (bzerr != BZ_OK) goto errhandler;
513 -
514 -+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True)
515 -+ {
516 -+ time(&currentTime);
517 -+
518 -+ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
519 -+ double curInPos = (double)ftell(stream);
520 -+ double curOutPos = (double)ftell(zStream);
521 -+
522 -+ startTime = currentTime;
523 -+
524 -+ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
525 -+ if (srcMode == SM_F2F)
526 -+ {
527 -+ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
528 -+ }
529 -+
530 -+ fprintf(stderr, " \r");
531 -+ }
532 -+ }
533 - }
534 -
535 - BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
536 - &nbytes_in_lo32, &nbytes_in_hi32,
537 - &nbytes_out_lo32, &nbytes_out_hi32 );
538 - if (bzerr != BZ_OK) goto errhandler;
539 --
540 -+
541 - if (ferror(zStream)) goto errhandler_io;
542 - ret = fflush ( zStream );
543 - if (ret == EOF) goto errhandler_io;
544 -@@ -526,6 +562,8 @@
545 - UChar unused[BZ_MAX_UNUSED];
546 - Int32 nUnused;
547 - UChar* unusedTmp;
548 -+ double fileSize = 0; /* initialized to make the compiler stop crying */
549 -+ time_t startTime, currentTime;
550 -
551 - nUnused = 0;
552 - streamNo = 0;
553 -@@ -533,9 +571,19 @@
554 - SET_BINARY_MODE(stream);
555 - SET_BINARY_MODE(zStream);
556 -
557 -+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
558 -+ long dummy = ftell(zStream);
559 -+ (void)fseek(zStream, 0, SEEK_END);
560 -+ fileSize = (double)ftell(zStream);
561 -+ (void)fseek(zStream, dummy, SEEK_SET);
562 -+ if (verbosity >= 1)
563 -+ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
564 -+ }
565 -+
566 - if (ferror(stream)) goto errhandler_io;
567 - if (ferror(zStream)) goto errhandler_io;
568 -
569 -+ time(&startTime);
570 - while (True) {
571 -
572 - bzf = BZ2_bzReadOpen (
573 -@@ -551,6 +599,17 @@
574 - if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
575 - fwrite ( obuf, sizeof(UChar), nread, stream );
576 - if (ferror(stream)) goto errhandler_io;
577 -+
578 -+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
579 -+ time(&currentTime);
580 -+ if ((currentTime - startTime) >= 2)
581 -+ {
582 -+ double curInPos = (double)ftell(zStream);
583 -+ startTime = currentTime;
584 -+
585 -+ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
586 -+ }
587 -+ }
588 - }
589 - if (bzerr != BZ_STREAM_END) goto errhandler;
590 -
591 -@@ -1872,6 +1931,7 @@
592 - deleteOutputOnInterrupt = False;
593 - exitValue = 0;
594 - i = j = 0; /* avoid bogus warning from egcs-1.1.X */
595 -+ showProgress = False;
596 -
597 - /*-- Set up signal handlers for mem access errors --*/
598 - signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
599 -@@ -1949,6 +2009,7 @@
600 - case 'k': keepInputFiles = True; break;
601 - case 's': smallMode = True; break;
602 - case 'q': noisy = False; break;
603 -+ case 'p': showProgress = True; break;
604 - case '1': blockSize100k = 1; break;
605 - case '2': blockSize100k = 2; break;
606 - case '3': blockSize100k = 3; break;
607 -@@ -1985,6 +2046,7 @@
608 - if (ISFLAG("--keep")) keepInputFiles = True; else
609 - if (ISFLAG("--small")) smallMode = True; else
610 - if (ISFLAG("--quiet")) noisy = False; else
611 -+ if (ISFLAG("--show-progress")) showProgress = True; else
612 - if (ISFLAG("--version")) license(); else
613 - if (ISFLAG("--license")) license(); else
614 - if (ISFLAG("--exponential")) workFactor = 1; else