diff options
author | 2004-08-21 05:53:45 +0000 | |
---|---|---|
committer | 2004-08-21 05:53:45 +0000 | |
commit | 25c47250463e1dca9a7d455d551a035cbc9c9d24 (patch) | |
tree | f412e5bfd250f900c5a505ab8da1abef97d610b1 | |
parent | move to x86/arm/hppa stable #60886 (diff) | |
download | historical-25c47250463e1dca9a7d455d551a035cbc9c9d24.tar.gz historical-25c47250463e1dca9a7d455d551a035cbc9c9d24.tar.bz2 historical-25c47250463e1dca9a7d455d551a035cbc9c9d24.zip |
clean up and fix #60852
-rw-r--r-- | sys-apps/buffer/ChangeLog | 9 | ||||
-rw-r--r-- | sys-apps/buffer/Manifest | 19 | ||||
-rw-r--r-- | sys-apps/buffer/buffer-1.19-r2.ebuild (renamed from sys-apps/buffer/buffer-1.19-r1.ebuild) | 22 | ||||
-rw-r--r-- | sys-apps/buffer/buffer-1.19.ebuild | 25 | ||||
-rw-r--r-- | sys-apps/buffer/files/1.19-deb-gentoo.patch | 293 | ||||
-rw-r--r-- | sys-apps/buffer/files/digest-buffer-1.19-r1 | 1 | ||||
-rw-r--r-- | sys-apps/buffer/files/digest-buffer-1.19-r2 (renamed from sys-apps/buffer/files/digest-buffer-1.19) | 0 |
7 files changed, 329 insertions, 40 deletions
diff --git a/sys-apps/buffer/ChangeLog b/sys-apps/buffer/ChangeLog index 77f95f341a36..31e050a75edf 100644 --- a/sys-apps/buffer/ChangeLog +++ b/sys-apps/buffer/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-apps/buffer # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/buffer/ChangeLog,v 1.5 2004/08/15 16:35:39 morfic Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/buffer/ChangeLog,v 1.6 2004/08/21 05:53:45 vapier Exp $ + +*buffer-1.19-r2 (21 Aug 2004) + + 21 Aug 2004; Mike Frysinger <vapier@gentoo.org> + +files/1.19-deb-gentoo.patch, +buffer-1.19-r2.ebuild: + Merge ugly sed crap into a patch along with useful things from debian and fix + lfs problems #60852. 15 Aug 2004; Daniel Goller <morfic@gentoo.org> buffer-1.19-r1.ebuild: removed offending code to close bug 60395 diff --git a/sys-apps/buffer/Manifest b/sys-apps/buffer/Manifest index de3ba953eaf7..281626f69d7a 100644 --- a/sys-apps/buffer/Manifest +++ b/sys-apps/buffer/Manifest @@ -1,6 +1,15 @@ -MD5 5b4aa8bd4288814a2b98613f119f06bd buffer-1.19.ebuild 601 -MD5 c260ea2034382d38ca6dd709950186c7 buffer-1.19-r1.ebuild 767 -MD5 c84c92c219f78de79da6b630049dfbf1 ChangeLog 737 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +MD5 eb1c99448e1eb74e33d95dc664baf11c ChangeLog 978 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 -MD5 1354a192cd741f1b34515ff718c8de27 files/digest-buffer-1.19 59 -MD5 1354a192cd741f1b34515ff718c8de27 files/digest-buffer-1.19-r1 59 +MD5 f84c33ec70007b09e0f66f9d1689ab01 buffer-1.19-r2.ebuild 796 +MD5 1354a192cd741f1b34515ff718c8de27 files/digest-buffer-1.19-r2 59 +MD5 4320cbc1275f8a854e3003e6d2f71d9c files/1.19-deb-gentoo.patch 8545 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.9.10 (GNU/Linux) + +iD8DBQFBJuN4HTu7gpaalycRAgH+AJ9gnjhEyQFKkvZ9BFeoi8gOKm9pdwCgmck/ +IJ4i+EsKovokon5xUTz/jIc= +=6Zox +-----END PGP SIGNATURE----- diff --git a/sys-apps/buffer/buffer-1.19-r1.ebuild b/sys-apps/buffer/buffer-1.19-r2.ebuild index 464317e3a9c8..d36bb2831de3 100644 --- a/sys-apps/buffer/buffer-1.19-r1.ebuild +++ b/sys-apps/buffer/buffer-1.19-r2.ebuild @@ -1,10 +1,12 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/buffer/buffer-1.19-r1.ebuild,v 1.7 2004/08/15 16:35:39 morfic Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/buffer/buffer-1.19-r2.ebuild,v 1.1 2004/08/21 05:53:45 vapier Exp $ + +inherit eutils flag-o-matic gcc DESCRIPTION="a tapedrive tool for speeding up reading from and writing to tape" -HOMEPAGE="http://www.microwerks.net/~hugo/download.html" -SRC_URI="http://www.microwerks.net/~hugo/download/${P}.tgz" +HOMEPAGE="http://www.microwerks.net/~hugo/" +SRC_URI="mirror://gentoo/${P}.tgz" LICENSE="GPL-2" SLOT="0" @@ -13,12 +15,16 @@ IUSE="" DEPEND="virtual/libc" +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${PV}-deb-gentoo.patch + make clean || die "make clean failed" +} + src_compile() { - make clean - sed -i "s:#ifndef __alpha::" buffer.c - sed -i "s:extern char \*shmat();::" buffer.c - sed -i "s:#endif /\* __alpha \*/::" buffer.c - emake || die "make failed" + append-lfs-flags + emake CC="$(gcc-getCC)" CFLAGS="${CFLAGS}" || die "make failed" } src_install() { diff --git a/sys-apps/buffer/buffer-1.19.ebuild b/sys-apps/buffer/buffer-1.19.ebuild deleted file mode 100644 index fa7818dfe0c6..000000000000 --- a/sys-apps/buffer/buffer-1.19.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/buffer/buffer-1.19.ebuild,v 1.7 2004/06/29 15:21:26 vapier Exp $ - -DESCRIPTION="a tapedrive tool for speeding up rewinding of tape" -HOMEPAGE="http://www.microwerks.net/~hugo/download.html" -SRC_URI="http://www.microwerks.net/~hugo/download/${P}.tgz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 amd64" -IUSE="" - -DEPEND="virtual/libc" -RDEPEND="" - -src_compile() { - make clean - emake || die "make failed" -} - -src_install() { - dobin buffer || die - dodoc README -} diff --git a/sys-apps/buffer/files/1.19-deb-gentoo.patch b/sys-apps/buffer/files/1.19-deb-gentoo.patch new file mode 100644 index 000000000000..6bd96c17a2e1 --- /dev/null +++ b/sys-apps/buffer/files/1.19-deb-gentoo.patch @@ -0,0 +1,293 @@ +diff -ur buffer-1.19.orig/buffer.c buffer-1.19/buffer.c +--- buffer-1.19.orig/buffer.c 2004-08-21 01:45:29.938082048 -0400 ++++ buffer-1.19/buffer.c 2004-08-21 01:45:39.444118464 -0400 +@@ -109,6 +109,9 @@ + * Initial revision + * + */ ++#include <stdlib.h> ++#include <string.h> ++#include <limits.h> + #include <unistd.h> + #include <stdio.h> + #include <signal.h> +@@ -120,15 +123,16 @@ + #include <sys/shm.h> + #include <sys/sem.h> + #include <sys/wait.h> ++#include <sys/time.h> + #include "sem.h" + + #ifndef lint + static char *rcsid = "$Header: /var/cvsroot/gentoo-x86/sys-apps/buffer/files/1.19-deb-gentoo.patch,v 1.1 2004/08/21 05:53:45 vapier Exp $"; + #endif + +-#ifndef __alpha ++#ifndef __linux__ + extern char *shmat(); +-#endif /* __alpha */ ++#endif /* __linux__ */ + + /* General macros */ + #define TRUE 1 +@@ -136,6 +140,14 @@ + #define K *1024 + #define M *1024*1024 + ++#if defined __GNUC__ || __STDC_VERSION__ >= 199901L ++#define NUM_K_TYPE unsigned long long ++#define NUM_K_FMT "llu" ++#else ++#define NUM_K_TYPE unsigned long ++#define NUM_K_FMT "lu" ++#endif ++ + /* Some forward declarations */ + void byee(); + void start_reader_and_writer(); +@@ -250,7 +262,9 @@ + + char print_total = 0; + /* Number of K output */ +-unsigned long outk = 0; ++NUM_K_TYPE outk = 0; ++ ++struct timeval starttime; + + int + main( argc, argv ) +@@ -262,6 +276,8 @@ + set_handlers(); + + buffer_allocate(); ++ ++ gettimeofday(&starttime, NULL); + + start_reader_and_writer(); + +@@ -384,8 +400,8 @@ + fprintf( stderr, "Usage: %s [-B] [-t] [-S size] [-m memsize] [-b blocks] [-p percent] [-s blocksize] [-u pause] [-i infile] [-o outfile] [-z size]\n", + progname ); + fprintf( stderr, "-B = blocked device - pad out last block\n" ); +- fprintf( stderr, "-t = show total amount writen at end\n" ); +- fprintf( stderr, "-S size = show amount writen every size bytes\n" ); ++ fprintf( stderr, "-t = show total amount written at end\n" ); ++ fprintf( stderr, "-S size = show amount written every size bytes\n" ); + fprintf( stderr, "-m size = size of shared mem chunk to grab\n" ); + fprintf( stderr, "-b num = number of blocks in queue\n" ); + fprintf( stderr, "-p percent = don't start writing until percent blocks filled\n" ); +@@ -397,6 +413,11 @@ + byee( -1 ); + } + } ++ ++ if (argc > optind) { ++ fprintf( stderr, "too many arguments\n" ); ++ byee( -1 ); ++ } + + if (zflag) showevery = blocksize; + +@@ -507,9 +528,9 @@ + get_buffer(); + + if( debug ) +- fprintf( stderr, "%s pbuffer is 0x%08x, buffer_size is %d [%d x %d]\n", ++ fprintf( stderr, "%s pbuffer is 0x%08lx, buffer_size is %d [%d x %d]\n", + proc_string, +- (char *)pbuffer, buffer_size, blocks, blocksize ); ++ (unsigned long)pbuffer, buffer_size, blocks, blocksize ); + + #ifdef SYS5 + memset( (char *)pbuffer, '\0', buffer_size ); +@@ -528,7 +549,17 @@ + pbuffer->blocks_free_lock = 1; + /* start this off so lock() can be called on it for each block + * till all the blocks are used up */ ++ /* Initializing the semaphore to "blocks - 1" causes a hang when using option ++ * "-p 100" because it always keeps one block free, so we'll never reach 100% fill ++ * level. However, there doesn't seem to be a good reason to keep one block free, ++ * so we initialize the semaphore to "blocks" instead. ++ * <mbuck@debian.org> 2004-01-11 ++ */ ++#if 0 + sem_set( pbuffer->semid, pbuffer->blocks_free_lock, blocks - 1 ); ++#else ++ sem_set( pbuffer->semid, pbuffer->blocks_free_lock, blocks ); ++#endif + + /* Detattach the shared memory so the fork doesnt do anything odd */ + shmdt( (char *)pbuffer ); +@@ -648,7 +679,7 @@ + int + fill_block() + { +- int bytes; ++ int bytes = 0; + char *start; + int toread; + static char eof_reached = 0; +@@ -707,7 +738,7 @@ + { + int filled = 0; + int maxfilled = (blocks * percent) / 100; +- int first_block; ++ int first_block = 0; + + if( debug ) + fprintf( stderr, "\tW: Entering writer\n blocks = %d\n maxfilled = %d\n", +@@ -742,7 +773,7 @@ + } + + if( print_total ){ +- fprintf( stderr, "Kilobytes Out %lu\n", outk ); ++ fprintf( stderr, "Kilobytes Out %" NUM_K_FMT "\n", outk ); + } + + if( debug ) +@@ -783,14 +814,14 @@ + void + write_block_to_stdout() + { +- static unsigned long out = 0; ++ unsigned long out = 0; + static unsigned long last_gb = 0; +- static unsigned long next_k = 0; ++ static NUM_K_TYPE next_k = 0; + int written; + + if( next_k == 0 && showevery ){ + if( debug > 3 ) +- fprintf( stderr, "W: next_k = %lu showevery = %d\n", next_k, showevery ); ++ fprintf( stderr, "W: next_k = %" NUM_K_FMT " showevery = %d\n", next_k, showevery ); + showevery = showevery / 1024; + next_k = showevery; + } +@@ -798,7 +829,7 @@ + if( (written = write( fdout, curr_block->data, curr_block->bytes )) != curr_block->bytes ){ + report_proc(); + perror( "write of data failed" ); +- fprintf( stderr, "bytes to write=%d, bytes written=%d, total written %10luK\n", curr_block->bytes, written, outk ); ++ fprintf( stderr, "bytes to write=%d, bytes written=%d, total written %10" NUM_K_FMT "K\n", curr_block->bytes, written, outk ); + byee( -1 ); + } + +@@ -825,7 +856,7 @@ + } + if( showevery ){ + if( debug > 3 ) +- fprintf( stderr, "W: outk = %lu, next_k = %lu\n", ++ fprintf( stderr, "W: outk = %" NUM_K_FMT ", next_k = %" NUM_K_FMT "\n", + outk, next_k ); + if( outk >= next_k ){ + pr_out(); +@@ -914,13 +945,12 @@ + do_size( arg ) + char *arg; + { +- char format[ 20 ]; +- int ret; ++ int ret = 0; + +- *format = '\0'; +- sscanf( arg, "%d%s", &ret, format ); ++ char unit = '\0'; ++ sscanf( arg, "%d%c", &ret, &unit ); + +- switch( *format ){ ++ switch( unit ){ + case 'm': + case 'M': + ret = ret K K; +@@ -941,7 +971,36 @@ + void + pr_out() + { +- fprintf( stderr, " %10luK\r", outk ); ++ struct timeval now; ++ unsigned long ms_delta, k_per_s; ++ ++ gettimeofday(&now, NULL); ++ ms_delta = (now.tv_sec - starttime.tv_sec) * 1000 ++ + (now.tv_usec - starttime.tv_usec) / 1000; ++ if (ms_delta) { ++ /* Use increased accuracy for small amounts of data, ++ * decreased accuracy for *huge* throughputs > 4.1GB/s ++ * to avoid division by 0. This will overflow if your ++ * machine's throughput exceeds 4TB/s - you deserve to ++ * loose if you're still using 32 bit longs on such a ++ * beast ;-) ++ * <mbuck@debian.org> ++ */ ++ if (outk < ULONG_MAX / 1000) { ++ k_per_s = (outk * 1000) / ms_delta; ++ } else if (ms_delta >= 1000) { ++ k_per_s = outk / (ms_delta / 1000); ++ } else { ++ k_per_s = (outk / ms_delta) * 1000; ++ } ++ fprintf( stderr, " %10" NUM_K_FMT "K, %10luK/s\r", outk, k_per_s ); ++ } else { ++ if (outk) { ++ fprintf( stderr, " %10" NUM_K_FMT "K, ?K/s\r", outk ); ++ } else { ++ fprintf( stderr, " 0K, 0K/s\r"); ++ } ++ } + } + + #ifdef SYS5 +diff -ur buffer-1.19.orig/buffer.man buffer-1.19/buffer.man +--- buffer-1.19.orig/buffer.man 2004-08-21 01:45:29.935085504 -0400 ++++ buffer-1.19/buffer.man 2004-08-21 01:45:39.441121920 -0400 +@@ -37,7 +37,8 @@ + Use the given file as the output file. The default is stdout. + .TP + .B \-S size +-After every chunk this size has been writen print out how much been writen so far. ++After every chunk of this size has been written, print out how much has ++been written so far. Also prints the total througput. + By default this is not set. + .TP + .B \-s size +@@ -71,9 +72,9 @@ + throughput on some drives.) + .TP + .B \-B +-Force each block writen to be padded out to the blocksize. This is needed by some tape ++Force each block written to be padded out to the blocksize. This is needed by some tape + and cartridge drives. Defaults to unpadded. This only affects the +-last block writen. ++last block written. + .TP + .B \-t + On exiting print to stderr a brief message showing the total number of +@@ -82,7 +83,7 @@ + .B \-Z + If reading/writing directly to a character device (like a tape drive) + then after each gigabyte perform an lseek to the start of the file. +-Use this flag with extreme care. If can only be used on devices where ++Use this flag with extreme care. It can only be used on devices where + an lseek does not rewind the tape but does reset the kernels position + flags. It is used to allow more than 2 gigabytes to be written. + .PP +diff -ur buffer-1.19.orig/sem.c buffer-1.19/sem.c +--- buffer-1.19.orig/sem.c 2004-08-21 01:45:29.939080896 -0400 ++++ buffer-1.19/sem.c 2004-08-21 01:47:41.265618240 -0400 +@@ -27,6 +27,7 @@ + * semaphores */ + + #include <stdio.h> ++#include <unistd.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/ipc.h> +@@ -95,7 +96,7 @@ + return sem; + } + +-static ++static void + do_sem( sem_id, pbuf, err ) + int sem_id; + struct sembuf *pbuf; diff --git a/sys-apps/buffer/files/digest-buffer-1.19-r1 b/sys-apps/buffer/files/digest-buffer-1.19-r1 deleted file mode 100644 index 99dba89f0c59..000000000000 --- a/sys-apps/buffer/files/digest-buffer-1.19-r1 +++ /dev/null @@ -1 +0,0 @@ -MD5 ef1f84473adb3bc2870dd5b0ad4ea82a buffer-1.19.tgz 34960 diff --git a/sys-apps/buffer/files/digest-buffer-1.19 b/sys-apps/buffer/files/digest-buffer-1.19-r2 index 99dba89f0c59..99dba89f0c59 100644 --- a/sys-apps/buffer/files/digest-buffer-1.19 +++ b/sys-apps/buffer/files/digest-buffer-1.19-r2 |