mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-26 09:46:09 +00:00
- Add moreutils-parallel 0.43 which was split from sysutils/moreutils
PR: ports/152973 Submitted by: Charlie Kester <corky1951@comcast.net>
This commit is contained in:
parent
872654feb2
commit
5065ade88a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=266433
@ -515,6 +515,7 @@
|
||||
SUBDIR += moosefs-client
|
||||
SUBDIR += moosefs-master
|
||||
SUBDIR += moreutils
|
||||
SUBDIR += moreutils-parallel
|
||||
SUBDIR += most
|
||||
SUBDIR += mount.app
|
||||
SUBDIR += mountsmb2
|
||||
|
33
sysutils/moreutils-parallel/Makefile
Normal file
33
sysutils/moreutils-parallel/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
# ex:ts=8
|
||||
# New ports collection makefile for: moreutils-parallel
|
||||
# Date created: 2010-12-09
|
||||
# Whom: Charlie Kester <corky1951@comcast.net>
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= moreutils-parallel
|
||||
PORTVERSION= 0.43
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= ${MASTER_SITE_DEBIAN_POOL}
|
||||
DISTNAME= moreutils_${PORTVERSION}
|
||||
|
||||
MAINTAINER= corky1951@comcast.net
|
||||
COMMENT= Run programs in parallel
|
||||
|
||||
CONFLICTS= parallel-[0-9]*
|
||||
|
||||
ALL_TARGET= bins
|
||||
WRKSRC= ${WRKDIR}/moreutils
|
||||
|
||||
MAN1= parallel.1
|
||||
MANCOMPRESSED= no
|
||||
PLIST_FILES= bin/parallel
|
||||
|
||||
post-patch:
|
||||
cd ${FILESDIR} && ${CP} ${MAN1} ${WRKSRC}/
|
||||
|
||||
post-install:
|
||||
cd ${WRKSRC} && ${INSTALL_MAN} ${MAN1} ${MANPREFIX}/man/man1/
|
||||
|
||||
.include <bsd.port.mk>
|
2
sysutils/moreutils-parallel/distinfo
Normal file
2
sysutils/moreutils-parallel/distinfo
Normal file
@ -0,0 +1,2 @@
|
||||
SHA256 (moreutils_0.43.tar.gz) = 09e31e4f308bb1e8f9ab4f7d57f9e3c8246e3e3824015534af59763114a85c7d
|
||||
SIZE (moreutils_0.43.tar.gz) = 44233
|
105
sysutils/moreutils-parallel/files/parallel.1
Normal file
105
sysutils/moreutils-parallel/files/parallel.1
Normal file
@ -0,0 +1,105 @@
|
||||
.\" -*- coding: us-ascii -*-
|
||||
.if \n(.g .ds T< \\FC
|
||||
.if \n(.g .ds T> \\F[\n[.fam]]
|
||||
.de URL
|
||||
\\$2 \(la\\$1\(ra\\$3
|
||||
..
|
||||
.if \n(.g .mso www.tmac
|
||||
.TH parallel 1 2009-07-02 "" ""
|
||||
.SH NAME
|
||||
parallel \- run programs in parallel
|
||||
.SH SYNOPSIS
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBparallel\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
[options] [command] \fB--\fR [argument ...]
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBparallel\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
[options] \fB--\fR [command ...]
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
.SH DESCRIPTION
|
||||
\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
|
||||
.TP
|
||||
\*(T<\fB\-j maxjobs\fR\*(T>
|
||||
Use to limit the number of jobs
|
||||
that are run at the same time.
|
||||
.TP
|
||||
\*(T<\fB\-l maxload\fR\*(T>
|
||||
Avoid starting new jobs when
|
||||
the system's load average is not below
|
||||
the specified limit.
|
||||
.TP
|
||||
\*(T<\fB\-i\fR\*(T>
|
||||
Normally the command is passed the
|
||||
argument at the end of its command line. With
|
||||
this option, the first instance of "{}" in
|
||||
the command is replaced with the argument.
|
||||
.TP
|
||||
\*(T<\fB\-n\fR\*(T>
|
||||
Number of arguments to pass to a
|
||||
command at a time. Default is 1.
|
||||
Incompatible with -i
|
||||
.SH EXAMPLE
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBparallel sh -c "echo hi; sleep 2; echo bye" -- 1 2 3\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
.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
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBparallel -j 3 ufraw -o processed -- *.NEF\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
.PP
|
||||
This runs three ufraw processes at the same time until
|
||||
all of the NEF files have been processed.
|
||||
.PP
|
||||
'nh
|
||||
.fi
|
||||
.ad l
|
||||
\fBparallel -j 3 -- ls df "echo hi"\fR \kx
|
||||
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
|
||||
'in \n(.iu+\nxu
|
||||
'in \n(.iu-\nxu
|
||||
.ad b
|
||||
'hy
|
||||
.PP
|
||||
This runs three independent commands in parallel.
|
||||
.SH "EXIT STATUS"
|
||||
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.)
|
63
sysutils/moreutils-parallel/files/patch-Makefile
Normal file
63
sysutils/moreutils-parallel/files/patch-Makefile
Normal file
@ -0,0 +1,63 @@
|
||||
--- ./Makefile.orig 2010-10-29 12:47:09.000000000 -0700
|
||||
+++ ./Makefile 2010-12-09 13:08:46.000000000 -0800
|
||||
@@ -1,51 +1,18 @@
|
||||
-BINS=isutf8 ifdata ifne pee sponge mispipe lckdo parallel
|
||||
-PERLSCRIPTS=vidir vipe ts combine zrun chronic
|
||||
-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
|
||||
-CFLAGS=-O2 -g -Wall
|
||||
+BINS=parallel
|
||||
+MANS=parallel.1
|
||||
+CFLAGS+= -Wall
|
||||
INSTALL_BIN?=install -s
|
||||
-PREFIX=/usr
|
||||
-
|
||||
-DOCBOOK2XMAN=docbook2x-man
|
||||
|
||||
all: $(BINS) $(MANS)
|
||||
+
|
||||
+bins: ${BINS}
|
||||
+
|
||||
+mans: ${MANS}
|
||||
|
||||
clean:
|
||||
rm -f $(BINS) $(MANS)
|
||||
|
||||
install:
|
||||
- mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||
- $(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
|
||||
- install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin
|
||||
+ mkdir -p $(PREFIX)/bin
|
||||
+ $(INSTALL_BIN) $(BINS) $(PREFIX)/bin
|
||||
|
||||
- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
|
||||
- install $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1
|
||||
-
|
||||
-check: isutf8
|
||||
- ./check-isutf8
|
||||
-
|
||||
-isutf8.1: isutf8.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-ifdata.1: ifdata.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-ifne.1: ifne.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-pee.1: pee.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-sponge.1: sponge.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-mispipe.1: mispipe.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-lckdo.1: lckdo.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-parallel.1: parallel.docbook
|
||||
- $(DOCBOOK2XMAN) $<
|
||||
-
|
||||
-%.1: %
|
||||
- pod2man --center=" " --release="moreutils" $< > $@;
|
29
sysutils/moreutils-parallel/files/patch-parallel.c
Normal file
29
sysutils/moreutils-parallel/files/patch-parallel.c
Normal file
@ -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;
|
10
sysutils/moreutils-parallel/pkg-descr
Normal file
10
sysutils/moreutils-parallel/pkg-descr
Normal file
@ -0,0 +1,10 @@
|
||||
The 'parallel' utility from the moreutils suite. Runs multiple jobs
|
||||
at once.
|
||||
|
||||
Made available as a seperate port so the rest of the suite can be
|
||||
installed without conflicting with sysutils/parallel.
|
||||
|
||||
moreutils is a growing collection of the unix tools that nobody
|
||||
thought to write thirty years ago.
|
||||
|
||||
WWW: http://kitenet.net/~joey/code/moreutils/
|
Loading…
Reference in New Issue
Block a user