Date: Thu, 09 Dec 2010 14:54:32 -0800 From: Charlie Kester <corky1951@comcast.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/152973: [NEW PORT] sysutils/moreutils-parallel: split out from sysutils/moreutils Message-ID: <20101209225438.8F3C81065783@hub.freebsd.org> Resent-Message-ID: <201012092300.oB9N0P08098188@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 152973 >Category: ports >Synopsis: [NEW PORT] sysutils/moreutils-parallel: split out from sysutils/moreutils >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Dec 09 23:00:24 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Charlie Kester >Release: FreeBSD 8.2-PRERELEASE i386 >Organization: >Environment: System: FreeBSD atom.local 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Fri Dec 3 20:10:55 PST 2010 root@atom.local:/usr/obj/usr/src/sys/ATOM i386 >Description: sysutils/moreutils is a suite of programs, one of which conflicts with sysutils/parallel. In order to allow users to install the remainder of the suite alongside sysutils/parallel, I'm moving the conflicting program to this new port. This one uses the same distfile as sysutils/moreutils. >How-To-Repeat: >Fix: --- moreutils-parallel.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # moreutils-parallel # moreutils-parallel/files # moreutils-parallel/files/parallel.1 # moreutils-parallel/files/patch-Makefile # moreutils-parallel/files/patch-parallel.c # moreutils-parallel/Makefile # moreutils-parallel/distinfo # moreutils-parallel/pkg-descr # echo c - moreutils-parallel mkdir -p moreutils-parallel > /dev/null 2>&1 echo c - moreutils-parallel/files mkdir -p moreutils-parallel/files > /dev/null 2>&1 echo x - moreutils-parallel/files/parallel.1 sed 's/^X//' >moreutils-parallel/files/parallel.1 << 'e83bb5a25e0bcb73f9a3e9c9435e7fdd' X.\" -*- coding: us-ascii -*- X.if \n(.g .ds T< \\FC X.if \n(.g .ds T> \\F[\n[.fam]] X.de URL X\\$2 \(la\\$1\(ra\\$3 X.. X.if \n(.g .mso www.tmac X.TH parallel 1 2009-07-02 "" "" X.SH NAME Xparallel \- run programs in parallel X.SH SYNOPSIS X'nh X.fi X.ad l X\fBparallel\fR \kx X.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) X'in \n(.iu+\nxu X[options] [command] \fB--\fR [argument ...] X'in \n(.iu-\nxu X.ad b X'hy X'nh X.fi X.ad l X\fBparallel\fR \kx X.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) X'in \n(.iu+\nxu X[options] \fB--\fR [command ...] X'in \n(.iu-\nxu X.ad b X'hy X.SH DESCRIPTION X\fBparallel\fR runs the specified command, Xpassing it a single one of the specified arguments. This is Xrepeated for each argument. Jobs may be run in Xparallel. The default is to run one job per CPU. X.PP XIf no command is specified before the --, Xthe commands after it are instead run in parallel. X.SH OPTIONS X.TP X\*(T<\fB\-j maxjobs\fR\*(T> XUse to limit the number of jobs Xthat are run at the same time. X.TP X\*(T<\fB\-l maxload\fR\*(T> XAvoid starting new jobs when Xthe system's load average is not below Xthe specified limit. X.TP X\*(T<\fB\-i\fR\*(T> XNormally the command is passed the Xargument at the end of its command line. With Xthis option, the first instance of "{}" in Xthe command is replaced with the argument. X.TP X\*(T<\fB\-n\fR\*(T> XNumber of arguments to pass to a Xcommand at a time. Default is 1. XIncompatible with -i X.SH EXAMPLE X'nh X.fi X.ad l X\fBparallel sh -c "echo hi; sleep 2; echo bye" -- 1 2 3\fR \kx X.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) X'in \n(.iu+\nxu X'in \n(.iu-\nxu X.ad b X'hy X.PP XThis runs three subshells that each print a message, delay, Xand print another message. If your system has multiple XCPUs, parallel will run some of the jobs in parallel, Xwhich should be clear from the order the messages are Xoutput. X.PP X'nh X.fi X.ad l X\fBparallel -j 3 ufraw -o processed -- *.NEF\fR \kx X.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) X'in \n(.iu+\nxu X'in \n(.iu-\nxu X.ad b X'hy X.PP XThis runs three ufraw processes at the same time until Xall of the NEF files have been processed. X.PP X'nh X.fi X.ad l X\fBparallel -j 3 -- ls df "echo hi"\fR \kx X.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) X'in \n(.iu+\nxu X'in \n(.iu-\nxu X.ad b X'hy X.PP XThis runs three independent commands in parallel. X.SH "EXIT STATUS" XIts exit status is the combination of the exit statuses of each Xcommand ran, ORed together. (Thus, if any one command Xexits nonzero, \fBparallel\fR as a whole will exit nonzero.) e83bb5a25e0bcb73f9a3e9c9435e7fdd echo x - moreutils-parallel/files/patch-Makefile sed 's/^X//' >moreutils-parallel/files/patch-Makefile << 'bece1bf19e26996088374f5363d32d7f' X--- ./Makefile.orig 2010-10-29 12:47:09.000000000 -0700 X+++ ./Makefile 2010-12-09 13:08:46.000000000 -0800 X@@ -1,51 +1,18 @@ X-BINS=isutf8 ifdata ifne pee sponge mispipe lckdo parallel X-PERLSCRIPTS=vidir vipe ts combine zrun chronic X-MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 ifne.1 pee.1 zrun.1 chronic.1 mispipe.1 lckdo.1 parallel.1 X-CFLAGS=-O2 -g -Wall X+BINS=parallel X+MANS=parallel.1 X+CFLAGS+= -Wall X INSTALL_BIN?=install -s X-PREFIX=/usr X- X-DOCBOOK2XMAN=docbook2x-man X X all: $(BINS) $(MANS) X+ X+bins: ${BINS} X+ X+mans: ${MANS} X X clean: X rm -f $(BINS) $(MANS) X X install: X- mkdir -p $(DESTDIR)$(PREFIX)/bin X- $(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin X- install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin X+ mkdir -p $(PREFIX)/bin X+ $(INSTALL_BIN) $(BINS) $(PREFIX)/bin X X- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 X- install $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1 X- X-check: isutf8 X- ./check-isutf8 X- X-isutf8.1: isutf8.docbook X- $(DOCBOOK2XMAN) $< X- X-ifdata.1: ifdata.docbook X- $(DOCBOOK2XMAN) $< X- X-ifne.1: ifne.docbook X- $(DOCBOOK2XMAN) $< X- X-pee.1: pee.docbook X- $(DOCBOOK2XMAN) $< X- X-sponge.1: sponge.docbook X- $(DOCBOOK2XMAN) $< X- X-mispipe.1: mispipe.docbook X- $(DOCBOOK2XMAN) $< X- X-lckdo.1: lckdo.docbook X- $(DOCBOOK2XMAN) $< X- X-parallel.1: parallel.docbook X- $(DOCBOOK2XMAN) $< X- X-%.1: % X- pod2man --center=" " --release="moreutils" $< > $@; bece1bf19e26996088374f5363d32d7f echo x - moreutils-parallel/files/patch-parallel.c sed 's/^X//' >moreutils-parallel/files/patch-parallel.c << '112312aad6482641d4b218c6e337730b' X--- ./parallel.c.orig 2010-07-06 12:06:47.000000000 -0700 X+++ ./parallel.c 2010-12-09 13:06:28.000000000 -0800 X@@ -87,6 +87,7 @@ X return; X } X X+#ifdef HAVE_WAITID X int wait_for_child(int options) { X id_t id_ignored = 0; X siginfo_t infop; X@@ -101,6 +102,18 @@ X } X return 1; X } X+#else X+int wait_for_child(int options) { X+ int status; X+ X+ if(waitpid(-1, &status, options) == -1) X+ return -1; /* nothing to wait for */ X+ if(WIFEXITED(status)) X+ return WEXITSTATUS(status); X+ return 1; X+} X+#endif X+ X X int main(int argc, char **argv) { X int maxjobs = -1; 112312aad6482641d4b218c6e337730b echo x - moreutils-parallel/Makefile sed 's/^X//' >moreutils-parallel/Makefile << '41ebcf83fecf66a047e74a817693abdd' X# ex:ts=8 X# Ports collection makefile for: moreutils X# Date created: 16 June 2009 X# Whom: Charlie Kester <corky1951@comcast.net> X# X# $FreeBSD: ports/sysutils/moreutils/Makefile,v 1.12 2010/11/18 09:34:11 sunpoet Exp $ X# X XPORTNAME= moreutils-parallel XPORTVERSION= 0.43 XCATEGORIES= sysutils XMASTER_SITES= ${MASTER_SITE_DEBIAN_POOL} XDISTNAME= moreutils_${PORTVERSION} X XMAINTAINER= corky1951@comcast.net XCOMMENT= Additional Unix utilities X XCONFLICTS= parallel-[0-9]* XPLIST_FILES= bin/parallel XALL_TARGET= bins XWRKSRC= ${WRKDIR}/moreutils XMAN1= parallel.1 XMANCOMPRESSED= no X Xpost-patch: X cd ${FILESDIR} && ${CP} ${MAN1} ${WRKSRC}/ Xpost-install: X cd ${WRKSRC} && ${INSTALL_MAN} ${MAN1} ${MANPREFIX}/man/man1/ X X.include <bsd.port.mk> 41ebcf83fecf66a047e74a817693abdd echo x - moreutils-parallel/distinfo sed 's/^X//' >moreutils-parallel/distinfo << '29860de50d7a0e47ab23d3f354e2e6b1' XSHA256 (moreutils_0.43.tar.gz) = 09e31e4f308bb1e8f9ab4f7d57f9e3c8246e3e3824015534af59763114a85c7d XSIZE (moreutils_0.43.tar.gz) = 44233 29860de50d7a0e47ab23d3f354e2e6b1 echo x - moreutils-parallel/pkg-descr sed 's/^X//' >moreutils-parallel/pkg-descr << 'f5221dd7b8b53c6225f2524dc1fe6763' XThe 'parallel' utility from the moreutils suite. Runs multiple jobs Xat once. X XMade available as a seperate port so the rest of the suite can be Xinstalled without conflicting with sysutils/parallel. X Xmoreutils is a growing collection of the unix tools that nobody Xthought to write thirty years ago. X XWWW: http://kitenet.net/~joey/code/moreutils/ f5221dd7b8b53c6225f2524dc1fe6763 exit --- moreutils-parallel.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101209225438.8F3C81065783>