Index: head/sysutils/moreutils/Makefile =================================================================== --- head/sysutils/moreutils/Makefile (revision 365294) +++ head/sysutils/moreutils/Makefile (revision 365295) @@ -1,66 +1,70 @@ # Created by: Charlie Kester # $FreeBSD$ PORTNAME= moreutils PORTVERSION= 0.51 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= DEBIAN_POOL DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= sunpoet@FreeBSD.org COMMENT= Additional Unix utilities LICENSE= GPLv2 RUN_DEPENDS= p5-IPC-Run>=0:${PORTSDIR}/devel/p5-IPC-Run OPTIONS_DEFINE= MANPAGES OPTIONS_DEFAULT=MANPAGES OPTIONS_SUB= yes ALL_TARGET= errnos.h ${CANNED_MANPAGES:R} USES= perl5 shebangfix WRKSRC= ${WRKDIR}/${PORTNAME} CANNED_MANPAGES=errno.1 \ ifdata.1 \ ifne.1 \ isutf8.1 \ lckdo.1 \ mispipe.1 \ + moreutils-parallel.1 \ pee.1 \ sponge.1 PERL_MANPAGES= chronic.1 \ combine.1 \ ts.1 \ vidir.1 \ vipe.1 \ zrun.1 SHEBANG_FILES= ${PERL_MANPAGES:R} post-patch: + @${REINPLACE_CMD} -e 's|parallel|moreutils-&|g' ${WRKSRC}/Makefile @${REINPLACE_CMD} -e 's|__APPLE__|__${OPSYS}__|' ${WRKSRC}/ifdata.c @cd ${FILESDIR}/ && ${CP} ${CANNED_MANPAGES} ${WRKSRC}/ + @${MV} ${WRKSRC}/parallel.c ${WRKSRC}/moreutils-parallel.c + @${MV} ${WRKSRC}/parallel.docbook ${WRKSRC}/moreutils-parallel.docbook post-build: .for man in ${PERL_MANPAGES:R} ${LOCALBASE}/bin/pod2man --center=" " --release="${PORTNAME}" ${WRKSRC}/${man} > ${WRKSRC}/${man}.1 .endfor do-install: cd ${WRKSRC}/ && ${INSTALL_PROGRAM} ${CANNED_MANPAGES:R} ${STAGEDIR}${PREFIX}/bin/ cd ${WRKSRC}/ && ${INSTALL_SCRIPT} ${PERL_MANPAGES:R} ${STAGEDIR}${PREFIX}/bin/ cd ${WRKSRC}/ && ${INSTALL_MAN} ${CANNED_MANPAGES} ${PERL_MANPAGES} ${STAGEDIR}${PREFIX}/man/man1/ # maintainer section: # require: docbook-xsl, libxml2, libxslt updateman: do-clean extract .for man in ${CANNED_MANPAGES:R} ${LOCALBASE}/bin/xmllint --noout --valid ${WRKSRC}/${man}.docbook && \ ${LOCALBASE}/bin/xsltproc --output ${FILESDIR}/${man}.1 --param man.authors.section.enabled 0 ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl ${WRKSRC}/${man}.docbook .endfor .include Index: head/sysutils/moreutils/files/moreutils-parallel.1 =================================================================== --- head/sysutils/moreutils/files/moreutils-parallel.1 (nonexistent) +++ head/sysutils/moreutils/files/moreutils-parallel.1 (revision 365295) @@ -0,0 +1,84 @@ +'\" t +.\" Title: parallel +.\" Author: Joey Hess +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 2009-07-02 +.\" Manual: moreutils +.\" Source: moreutils +.\" Language: English +.\" +.TH "PARALLEL" "1" "2009\-07\-02" "moreutils" "moreutils" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +parallel \- run programs in parallel +.SH "SYNOPSIS" +.HP \w'\fBparallel\fR\fB\-\-\fR\ 'u +\fBparallel\fR [options] [command]\fB\-\-\fR [argument\ \&.\&.\&.] +.HP \w'\fBparallel\fR\fB\-\-\fR\ 'u +\fBparallel\fR [options]\fB\-\-\fR [command\ \&.\&.\&.] +.SH "DESCRIPTION" +.PP +\fBparallel\fR +runs the specified command, passing it a single one of the specified arguments\&. This is repeated for each argument\&. Jobs may be run in parallel\&. The default is to run one job per CPU\&. +.PP +If no command is specified before the \-\-, the commands after it are instead run in parallel\&. +.SH "OPTIONS" +.PP +\fB\-j maxjobs\fR +.RS 4 +Use to limit the number of jobs that are run at the same time\&. +.RE +.PP +\fB\-l maxload\fR +.RS 4 +Wait as needed to avoid starting new jobs when the system\*(Aqs load average is not below the specified limit\&. +.RE +.PP +\fB\-i\fR +.RS 4 +Normally the command is passed the argument at the end of its command line\&. With this option, any instances of "{}" in the command are replaced with the argument\&. +.RE +.PP +\fB\-n\fR +.RS 4 +Number of arguments to pass to a command at a time\&. Default is 1\&. Incompatible with \-i +.RE +.SH "EXAMPLE" +.PP +.HP \w'\fBparallel\ sh\ \-c\ "echo\ hi;\ sleep\ 2;\ echo\ bye"\ \-\-\ 1\ 2\ 3\fR\ 'u \fBparallel sh \-c "echo hi; sleep 2; echo bye" \-\- 1 2 3\fR +.PP +This runs three subshells that each print a message, delay, and print another message\&. If your system has multiple CPUs, parallel will run some of the jobs in parallel, which should be clear from the order the messages are output\&. +.PP +.HP \w'\fBparallel\ \-j\ 3\ ufraw\ \-o\ processed\ \-\-\ *\&.NEF\fR\ 'u \fBparallel \-j 3 ufraw \-o processed \-\- *\&.NEF\fR +.PP +This runs three ufraw processes at the same time until all of the NEF files have been processed\&. +.PP +.HP \w'\fBparallel\ \-j\ 3\ \-\-\ ls\ df\ "echo\ hi"\fR\ 'u \fBparallel \-j 3 \-\- ls df "echo hi"\fR +.PP +This runs three independent commands in parallel\&. +.SH "EXIT STATUS" +.PP +Its exit status is the combination of the exit statuses of each command ran, ORed together\&. (Thus, if any one command exits nonzero, +\fBparallel\fR +as a whole will exit nonzero\&.) +.SH "AUTHOR" +.PP +Tollef Fog Heen Property changes on: head/sysutils/moreutils/files/moreutils-parallel.1 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/moreutils/files/patch-moreutils-parallel.c =================================================================== --- head/sysutils/moreutils/files/patch-moreutils-parallel.c (nonexistent) +++ head/sysutils/moreutils/files/patch-moreutils-parallel.c (revision 365295) @@ -0,0 +1,29 @@ +--- ./parallel.c.orig 2010-07-06 12:06:47.000000000 -0700 ++++ ./parallel.c 2010-11-17 15:49:57.000000000 -0800 +@@ -87,6 +87,7 @@ + return; + } + ++#ifdef HAVE_WAITID + int wait_for_child(int options) { + id_t id_ignored = 0; + siginfo_t infop; +@@ -101,6 +102,18 @@ + } + return 1; + } ++#else ++int wait_for_child(int options) { ++ int status; ++ ++ if(waitpid(-1, &status, options) == -1) ++ return -1; /* nothing to wait for */ ++ if(WIFEXITED(status)) ++ return WEXITSTATUS(status); ++ return 1; ++} ++#endif ++ + + int main(int argc, char **argv) { + int maxjobs = -1; Property changes on: head/sysutils/moreutils/files/patch-moreutils-parallel.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/moreutils/pkg-descr =================================================================== --- head/sysutils/moreutils/pkg-descr (revision 365294) +++ head/sysutils/moreutils/pkg-descr (revision 365295) @@ -1,22 +1,23 @@ This is a collection of the unix tools that nobody thought to write long ago, when unix was young. Currently it consists of these tools: - chronic: runs a command quietly unless it fails - combine: combine the lines in two files using boolean operations - errno: look up errno names and descriptions - ifdata: get network interface info without parsing ifconfig output - ifne: run a command if the standard input is not empty - isutf8: check if a file or standard input is utf-8 - lckdo: execute a program with a lock held (deprecated) - mispipe: pipe two commands, returning the exit status of the first +- parallel: run multiple jobs at once - pee: tee standard input to pipes - sponge: soak up standard input and write to a file - ts: timestamp standard input - vidir: edit a directory in your text editor - vipe: insert a text editor into a pipe - zrun: automatically uncompress arguments to command -The 'parallel' utility is split into sysutils/moreutils-parallel. +Note that the parallel utility is installed as moreutils-parallel. WWW: http://joeyh.name/code/moreutils/ Index: head/sysutils/moreutils/pkg-plist =================================================================== --- head/sysutils/moreutils/pkg-plist (revision 365294) +++ head/sysutils/moreutils/pkg-plist (revision 365295) @@ -1,28 +1,30 @@ bin/chronic bin/combine bin/errno bin/ifdata bin/ifne bin/isutf8 bin/lckdo bin/mispipe +bin/moreutils-parallel bin/pee bin/sponge bin/ts bin/vidir bin/vipe bin/zrun %%MANPAGES%%man/man1/chronic.1.gz %%MANPAGES%%man/man1/combine.1.gz %%MANPAGES%%man/man1/errno.1.gz %%MANPAGES%%man/man1/ifdata.1.gz %%MANPAGES%%man/man1/ifne.1.gz %%MANPAGES%%man/man1/isutf8.1.gz %%MANPAGES%%man/man1/lckdo.1.gz %%MANPAGES%%man/man1/mispipe.1.gz +%%MANPAGES%%man/man1/moreutils-parallel.1.gz %%MANPAGES%%man/man1/pee.1.gz %%MANPAGES%%man/man1/sponge.1.gz %%MANPAGES%%man/man1/ts.1.gz %%MANPAGES%%man/man1/vidir.1.gz %%MANPAGES%%man/man1/vipe.1.gz %%MANPAGES%%man/man1/zrun.1.gz