diff options
author | hubertf <hubertf> | 1997-10-11 21:53:59 +0000 |
---|---|---|
committer | hubertf <hubertf> | 1997-10-11 21:53:59 +0000 |
commit | f5ee8e2561694e498edddcfba4a7f15ea35e3c17 (patch) | |
tree | cd1e0be6347cb17aeb9201b0ecc45b0286c98b53 /misc/team | |
parent | ef17a602de1210761f4ecdc6eea0e872eae46423 (diff) | |
download | pkgsrc-f5ee8e2561694e498edddcfba4a7f15ea35e3c17.tar.gz |
Import as of 09/25/97
Diffstat (limited to 'misc/team')
-rw-r--r-- | misc/team/Makefile | 15 | ||||
-rw-r--r-- | misc/team/files/md5 | 1 | ||||
-rw-r--r-- | misc/team/patches/patch-a | 34 | ||||
-rw-r--r-- | misc/team/patches/patch-b | 28 | ||||
-rw-r--r-- | misc/team/patches/patch-c | 453 | ||||
-rw-r--r-- | misc/team/patches/patch-d | 146 | ||||
-rw-r--r-- | misc/team/patches/patch-e | 15 | ||||
-rw-r--r-- | misc/team/pkg/COMMENT | 1 | ||||
-rw-r--r-- | misc/team/pkg/DESCR | 17 | ||||
-rw-r--r-- | misc/team/pkg/PLIST | 2 |
10 files changed, 712 insertions, 0 deletions
diff --git a/misc/team/Makefile b/misc/team/Makefile new file mode 100644 index 00000000000..b3bdb72c206 --- /dev/null +++ b/misc/team/Makefile @@ -0,0 +1,15 @@ +# New ports collection makefile for: team +# Version required: 3.1 (From the RCS Id line of team.c) +# Date created: 1 July 1995 +# Whom: joerg +# +# $Id: Makefile,v 1.1.1.1 1997/10/11 21:55:00 hubertf Exp $ +# + +DISTNAME= team-3.1 +CATEGORIES= misc +MASTER_SITES= ${MASTER_SITE_LOCAL} + +MAINTAINER= joerg@FreeBSD.org + +.include <bsd.port.mk> diff --git a/misc/team/files/md5 b/misc/team/files/md5 new file mode 100644 index 00000000000..45ee3aa62cc --- /dev/null +++ b/misc/team/files/md5 @@ -0,0 +1 @@ +MD5 (team-3.1.tar.gz) = e2095ee087a61d784bd2e296724d4316 diff --git a/misc/team/patches/patch-a b/misc/team/patches/patch-a new file mode 100644 index 00000000000..2a8bd311e97 --- /dev/null +++ b/misc/team/patches/patch-a @@ -0,0 +1,34 @@ +diff -u team-3.1/Makefile ./Makefile +--- team-3.1/Makefile Sat Jul 1 17:33:24 1995 ++++ ./Makefile Sat Jul 1 17:53:20 1995 +@@ -1,25 +1,8 @@ +-CFLAGS =-O +-LDFLAGS =-s ++PROG= team + +-INSTX =install -m 0755 -s +-INSTD =install -m 0644 ++BINDIR= ${PREFIX}/bin ++MANDIR= ${PREFIX}/man/man + +-DEST= ++CFLAGS+= -DHAVE_PARAM_H + +-MI =$(DEST)/usr/ +-MD =$(DEST)/usr/ +- +-M1X =1 +- +-BIND =$(MD)bin/ +-MANI =$(MI)man +- +-MANI1 =$(MANI)$(M1X)/ +- +-all: team +- +-clean:: +- rm -f team team.o +- +-$(BIND)team: team; $(INSTX) $? $@ +-$(MANI1)team.$(M1X): team.1; $(INSTD) $? $@ ++.include <bsd.prog.mk> diff --git a/misc/team/patches/patch-b b/misc/team/patches/patch-b new file mode 100644 index 00000000000..293325e09a3 --- /dev/null +++ b/misc/team/patches/patch-b @@ -0,0 +1,28 @@ +diff -u team-3.1/team.c ./team.c +--- team-3.1/team.c Sat Jul 1 17:33:24 1995 ++++ ./team.c Sat Jul 1 17:54:05 1995 +@@ -85,6 +85,11 @@ + #include <sys/stat.h> + #include <fcntl.h> + ++#ifdef HAVE_PARAM_H ++#include <sys/param.h> ++#endif ++ ++ + #ifdef sun + # undef F_SETLKW + #endif +@@ -286,7 +291,12 @@ + do + { + #if (defined i386 || defined sun) ++# if !(defined(BSD) && (BSD >= 199306)) + extern char *(sys_errlist[]); ++# endif ++# if (defined(BSD) && (BSD >= 199306)) && __STDC__ ++ const ++# endif + char *errmsg = sys_errlist[errno]; + #else + char errmsg[32]; diff --git a/misc/team/patches/patch-c b/misc/team/patches/patch-c new file mode 100644 index 00000000000..3cc2b11cf5e --- /dev/null +++ b/misc/team/patches/patch-c @@ -0,0 +1,453 @@ +*** team.c.ORIG Wed Nov 6 17:51:42 1996 +--- team.c Wed Nov 6 18:07:15 1996 +*************** +*** 58,65 **** + upstream to it, which has much the same effect. + */ + +! #define TeamLVOLSZ (1L<<10) +! #define TeamHVOLSZ ((long unsigned) 3 * ((long unsigned) 1 << 30)) + + #define TeamLBUFSZ (64) /* Low buffer size */ + #define TeamDBUFSZ (60*512) /* Default buffer size */ +--- 58,65 ---- + upstream to it, which has much the same effect. + */ + +! #define TeamLVOLSZ (off_t unsigned)(1L<<10) +! #define TeamHVOLSZ ((off_t unsigned) 3 * ((off_t unsigned) 1 << 62)) + + #define TeamLBUFSZ (64) /* Low buffer size */ + #define TeamDBUFSZ (60*512) /* Default buffer size */ +*************** +*** 195,201 **** + { + int fd; + short status; +! long unsigned size; + }; + + local Fd FdIn,FdOut; +--- 195,201 ---- + { + int fd; + short status; +! off_t unsigned size; + }; + + local Fd FdIn,FdOut; +*************** +*** 204,210 **** + ( + fast Fd *fd + _ int ffd +! _ long unsigned size + ) + { + fd->status = (ffd >= 0) ? FdOPEN : FdCLOSED; +--- 204,210 ---- + ( + fast Fd *fd + _ int ffd +! _ off_t unsigned size + ) + { + fd->status = (ffd >= 0) ? FdOPEN : FdCLOSED; +*************** +*** 257,268 **** + to->fd = from->fd; + } + +! local long unsigned FdRetry on((fd,which,done,space)) is + ( + fast Fd *fd + _ char *which +! _ long unsigned done +! _ long unsigned space + ) + { + int tty; +--- 257,268 ---- + to->fd = from->fd; + } + +! local off_t unsigned FdRetry on((fd,which,done,space)) is + ( + fast Fd *fd + _ char *which +! _ off_t unsigned done +! _ off_t unsigned space + ) + { + int tty; +*************** +*** 303,311 **** + (void) sprintf(errmsg,"Error %d",errno); + #endif + if (errno) +! mesg("'%s' on %s after %luk. Continue [cyn] ? ",errmsg,which,done>>10); + else +! mesg("EOF on %s after %luk. Continue [cyn] ? ",which,done>>10); + + read(tty,reply,sizeof reply); + } +--- 303,311 ---- + (void) sprintf(errmsg,"Error %d",errno); + #endif + if (errno) +! mesg("'%s' on %s after %quk. Continue [cyn] ? ",errmsg,which,done>>10); + else +! mesg("EOF on %s after %quk. Continue [cyn] ? ",which,done>>10); + + read(tty,reply,sizeof reply); + } +*************** +*** 330,336 **** + local unsigned FdCanDo on((remaining,available)) is + ( + fast address remaining +! _ fast long unsigned available + ) + { + return (remaining < available) +--- 330,336 ---- + local unsigned FdCanDo on((remaining,available)) is + ( + fast address remaining +! _ fast off_t unsigned available + ) + { + return (remaining < available) +*************** +*** 342,351 **** + fast Fd *fd + _ pointer buffer + _ fast address todo +! _ long unsigned done + ) + { +! fast long unsigned space; + fast int bytesRead; + fast address justDone; + +--- 342,351 ---- + fast Fd *fd + _ pointer buffer + _ fast address todo +! _ off_t unsigned done + ) + { +! fast off_t unsigned space; + fast int bytesRead; + fast address justDone; + +*************** +*** 383,392 **** + fast Fd *fd + _ pointer buffer + _ fast address todo +! _ long unsigned done + ) + { +! fast long unsigned space; + fast int bytesWritten; + fast address justDone; + +--- 383,392 ---- + fast Fd *fd + _ pointer buffer + _ fast address todo +! _ off_t unsigned done + ) + { +! fast off_t unsigned space; + fast int bytesWritten; + fast address justDone; + +*************** +*** 463,469 **** + { + Token token; + short status; +! long unsigned done; + }; + + local bool StreamSend on((fd,token,status,done)) is +--- 463,469 ---- + { + Token token; + short status; +! off_t unsigned done; + }; + + local bool StreamSend on((fd,token,status,done)) is +*************** +*** 471,477 **** + fast Fd *fd + _ Token token + _ short status +! _ long unsigned done + ) + { + fast int n; +--- 471,477 ---- + fast Fd *fd + _ Token token + _ short status +! _ off_t unsigned done + ) + { + fast int n; +*************** +*** 493,499 **** + fast Fd *fd + _ Token *tokenp + _ short *statusp +! _ long unsigned *donep + ) + { + fast int n; +--- 493,499 ---- + fast Fd *fd + _ Token *tokenp + _ short *statusp +! _ off_t unsigned *donep + ) + { + fast int n; +*************** +*** 546,552 **** + #define GuyRECEIVE(guy,tokenp,statusp,donep) \ + StreamReceive(&guy->upStream,tokenp,statusp,donep) + +! local bool GuyStop of((Guy *,char *,long unsigned)); + + local bool GuyStart on((guy,bufsize)) is + ( +--- 546,552 ---- + #define GuyRECEIVE(guy,tokenp,statusp,donep) \ + StreamReceive(&guy->upStream,tokenp,statusp,donep) + +! local bool GuyStop of((Guy *,char *,off_t unsigned)); + + local bool GuyStart on((guy,bufsize)) is + ( +*************** +*** 557,563 **** + fast char *buffer; + Token token; + short status; +! long unsigned done; + bool received; + static int bytesRead,bytesWritten; + +--- 557,563 ---- + fast char *buffer; + Token token; + short status; +! off_t unsigned done; + bool received; + static int bytesRead,bytesWritten; + +*************** +*** 587,593 **** + done += bytesRead; + + if (verbose) +! mesg("%luk read \r",done>>10); + + if (!GuySEND(guy,TokenREAD,FdIn.status,done)) + GuyStop(guy,"guy cannot send READ",done); +--- 587,593 ---- + done += bytesRead; + + if (verbose) +! mesg("%quk read \r",done>>10); + + if (!GuySEND(guy,TokenREAD,FdIn.status,done)) + GuyStop(guy,"guy cannot send READ",done); +*************** +*** 605,611 **** + done += bytesWritten; + + if (verbose) +! mesg("%luk written\r",done>>10); + + if (!GuySEND(guy,TokenWRITE,FdOut.status,done)) + GuyStop(guy,"guy cannot send WRITE",done); +--- 605,611 ---- + done += bytesWritten; + + if (verbose) +! mesg("%quk written\r",done>>10); + + if (!GuySEND(guy,TokenWRITE,FdOut.status,done)) + GuyStop(guy,"guy cannot send WRITE",done); +*************** +*** 629,635 **** + ( + fast Guy *guy + _ char *errormsg +! _ long unsigned done + ) + { + Mesg(("GuyStop guy %#o\n",guy)); +--- 629,635 ---- + ( + fast Guy *guy + _ char *errormsg +! _ off_t unsigned done + ) + { + Mesg(("GuyStop guy %#o\n",guy)); +*************** +*** 637,644 **** + if (done) + { + if (report) +! mesg("%lu kilobytes, %lu seconds\r\n", +! done>>10,(long unsigned) (time((time_t *) 0)-origin)); + else if (verbose) + mesg("\n"); + } +--- 637,644 ---- + if (done) + { + if (report) +! mesg("%qu kilobytes, %lu seconds\r\n", +! done>>10,(off_t unsigned) (time((time_t *) 0)-origin)); + else if (verbose) + mesg("\n"); + } +*************** +*** 707,714 **** + ( + fast Team *team + _ address bufsize +! _ long unsigned isize +! _ long unsigned osize + ) + { + /* +--- 707,714 ---- + ( + fast Team *team + _ address bufsize +! _ off_t unsigned isize +! _ off_t unsigned osize + ) + { + /* +*************** +*** 924,931 **** + syntax: team [-[vr]] [-iI[bkm] [-oO[bkm] [N[bkm] [P]]\n\ + copies standard input to output\n\ + -v gives ongoing report, -r final report\n\ +! I is input volume size (default %lum)\n\ +! O is output volume size (default %lum)\n\ + N is buffer size (default %luk)\n\ + P is number of processes (default %u)\n\ + (postfix b means *512, k means *1KB, m means *1MB)\n\ +--- 924,931 ---- + syntax: team [-[vr]] [-iI[bkm] [-oO[bkm] [N[bkm] [P]]\n\ + copies standard input to output\n\ + -v gives ongoing report, -r final report\n\ +! I is input volume size (default %qum)\n\ +! O is output volume size (default %qum)\n\ + N is buffer size (default %luk)\n\ + P is number of processes (default %u)\n\ + (postfix b means *512, k means *1KB, m means *1MB)\n\ +*************** +*** 937,955 **** + /*NOTREACHED*/ + } + +! local long unsigned atos on((s)) is + ( + fast char *s + ) + { +! fast unsigned long l; + + for ( + s, l = 0L; + *s >= '0' && *s <= '9'; + s++ + ) +! l = l*10L + (long unsigned) (*s-'0'); + + if (*s == 'b') l *= (1L<<9); + if (*s == 'k') l *= (1L<<10); +--- 937,955 ---- + /*NOTREACHED*/ + } + +! local off_t unsigned atos on((s)) is + ( + fast char *s + ) + { +! fast off_t unsigned l; + + for ( + s, l = 0L; + *s >= '0' && *s <= '9'; + s++ + ) +! l = l*10L + (off_t unsigned) (*s-'0'); + + if (*s == 'b') l *= (1L<<9); + if (*s == 'k') l *= (1L<<10); +*************** +*** 968,975 **** + short unsigned teamsize; + + address bufsize; +! long unsigned isize; +! long unsigned osize; + int opt; + + teamsize = TeamDTEAMSZ; +--- 968,975 ---- + short unsigned teamsize; + + address bufsize; +! off_t unsigned isize; +! off_t unsigned osize; + int opt; + + teamsize = TeamDTEAMSZ; +*************** +*** 985,991 **** + isize = atos(optarg); + if (isize < TeamLVOLSZ || isize > TeamHVOLSZ) + { +! fprintf(stderr,"team: invalid input volume size %lu\n",isize); + usage(); + } + +--- 985,991 ---- + isize = atos(optarg); + if (isize < TeamLVOLSZ || isize > TeamHVOLSZ) + { +! fprintf(stderr,"team: invalid input volume size %qu\n",isize); + usage(); + } + +*************** +*** 993,999 **** + osize = atos(optarg); + if (osize < TeamLVOLSZ || osize > TeamHVOLSZ) + { +! fprintf(stderr,"team: invalid output volume size %lu\n",osize); + usage(); + } + +--- 993,999 ---- + osize = atos(optarg); + if (osize < TeamLVOLSZ || osize > TeamHVOLSZ) + { +! fprintf(stderr,"team: invalid output volume size %qu\n",osize); + usage(); + } + diff --git a/misc/team/patches/patch-d b/misc/team/patches/patch-d new file mode 100644 index 00000000000..53b4698adb0 --- /dev/null +++ b/misc/team/patches/patch-d @@ -0,0 +1,146 @@ +*** Makefile.ORIG Fri Dec 13 16:26:46 1996 +--- Makefile Sat Dec 14 11:01:06 1996 +*************** +*** 3,8 **** + BINDIR= ${PREFIX}/bin + MANDIR= ${PREFIX}/man/man + +! CFLAGS+= -DHAVE_PARAM_H + + .include <bsd.prog.mk> +--- 3,8 ---- + BINDIR= ${PREFIX}/bin + MANDIR= ${PREFIX}/man/man + +! CFLAGS+= -DHAVE_PARAM_H -DHAVE_WAIT_H + + .include <bsd.prog.mk> +*** team.c.ORIG Fri Dec 13 16:26:50 1996 +--- team.c Sun Dec 15 10:35:10 1996 +*************** +*** 84,89 **** +--- 84,92 ---- + #include <sys/file.h> + #include <sys/stat.h> + #include <fcntl.h> ++ #ifdef HAVE_WAIT_H ++ #include <sys/wait.h> ++ #endif + + #ifdef HAVE_PARAM_H + #include <sys/param.h> +*************** +*** 165,170 **** +--- 168,174 ---- + + local bool verbose = false; + local bool report = true; ++ local bool guyhaderror = false; + + extern int errno; + local time_t origin; +*************** +*** 647,653 **** + { + mesg("team: guy pid %u: %s\n",guy->pid,errormsg); + call GuySEND(guy,TokenABORT,FdERROR,0L); +! exit(1); + /*NOTREACHED*/ + } + +--- 651,657 ---- + { + mesg("team: guy pid %u: %s\n",guy->pid,errormsg); + call GuySEND(guy,TokenABORT,FdERROR,0L); +! exit(2); + /*NOTREACHED*/ + } + +*************** +*** 807,812 **** +--- 811,819 ---- + { + pid = getpid(); + ++ /* Set SIGPIPE handling back to the default in the guys */ ++ signal(SIGPIPE, SIG_DFL); ++ + if (!FdClose(&last_downstream)) + perror("cannot close inherited first link"); + +*************** +*** 826,838 **** + } + } + +! if (!StreamSend(&last_downstream,TokenREAD,FdOPEN,0L)) + { + perror("cannot send first READ token"); + return false; + } + +! if (!StreamSend(&last_downstream,TokenWRITE,FdOPEN,0L)) + { + perror("cannot send first WRITE token"); + return false; +--- 833,845 ---- + } + } + +! if (!StreamSend(&last_downstream,TokenREAD,FdOPEN,0L) && errno != EPIPE) + { + perror("cannot send first READ token"); + return false; + } + +! if (!StreamSend(&last_downstream,TokenWRITE,FdOPEN,0L) && errno != EPIPE) + { + perror("cannot send first WRITE token"); + return false; +*************** +*** 874,879 **** +--- 881,894 ---- + + --team->active; + ++ #ifdef WIFEXITED ++ /* If a guy had an error, its exit status is 2. Also catch a killed guy */ ++ if ((WIFEXITED(status) && WEXITSTATUS(status) == 2) || ++ (WIFSIGNALED(status) && WTERMSIG(status) != SIGPIPE)) { ++ guyhaderror = true; ++ } ++ #endif ++ + if (status != 0 && team->active != 0) + return false; + } +*************** +*** 1042,1047 **** +--- 1057,1067 ---- + + origin = time((time_t *) 0); + ++ /* ++ * Ignore SIGPIPE in the parent as it affects the exit status reporting. ++ */ ++ signal(SIGPIPE, SIG_IGN); ++ + if (!TeamStart(&team,bufsize,isize,osize)) + { + mesg("team: cannot start the team\n"); +*************** +*** 1062,1067 **** +--- 1082,1093 ---- + if (!TeamClose(&team)) + { + mesg("team: cannot close the team\n"); ++ return 1; ++ } ++ ++ if (guyhaderror) ++ { ++ mesg("team: guy had error\n"); + return 1; + } + + diff --git a/misc/team/patches/patch-e b/misc/team/patches/patch-e new file mode 100644 index 00000000000..b54f83d040e --- /dev/null +++ b/misc/team/patches/patch-e @@ -0,0 +1,15 @@ +*** team.c.ORIG Fri Dec 13 16:26:50 1996 +--- team.c Fri Dec 13 16:28:14 1996 +*************** +*** 94,99 **** +--- 94,103 ---- + # undef F_SETLKW + #endif + ++ #ifdef __FreeBSD__ ++ # undef F_SETLKW ++ #endif ++ + #if (PCG) + # include "Extend.h" + # include "Here.h" diff --git a/misc/team/pkg/COMMENT b/misc/team/pkg/COMMENT new file mode 100644 index 00000000000..13af6a9fa7d --- /dev/null +++ b/misc/team/pkg/COMMENT @@ -0,0 +1 @@ +Portable multi-buffered tape streaming utility. diff --git a/misc/team/pkg/DESCR b/misc/team/pkg/DESCR new file mode 100644 index 00000000000..ff1cf0979d9 --- /dev/null +++ b/misc/team/pkg/DESCR @@ -0,0 +1,17 @@ +Submitted-By: pcg@aber.ac.uk (Piercarlo Grandi) +Posting-Number: Volume 27, Issue 195 +Archive-Name: team/part01 + +There exist a few filters that help tapes streams by buffering IO and +allowing reads to overlaps with writes under Unix. Most of these filters +rely on relatively unportable features, for example SYSV like shared +memory. + +team is a filter that runs essentially unchanged on any Unix version, as +it relies only on features present in V7. A number of team processes +(team members) share a common input fd and a common output fd, and they +take turns at reading from the former and writing to the latter; they +synchronize by using a ring of pipes between them, where a "read-enable" +and a "write-enable" token circulate. + +The team source is GPL'ed, and it comes with no warranty. diff --git a/misc/team/pkg/PLIST b/misc/team/pkg/PLIST new file mode 100644 index 00000000000..41c7a200c31 --- /dev/null +++ b/misc/team/pkg/PLIST @@ -0,0 +1,2 @@ +bin/team +man/man1/team.1.gz |