Bug#908844: pkg-perl-tools: use xargs -P instead of parallel
Adam Borowski
kilobyte at angband.pl
Fri Sep 14 23:38:10 BST 2018
Source: pkg-perl-tools
Version: 0.47
Severity: wishlist
Hi!
While looking at users of "parallel" (wrt its licensing problem), I noticed
quite bizarre handling:
PARALLEL=
if which parallel > /dev/null ; then
if parallel --will-cite < /dev/null > /dev/null 2>&1; then
PARALLEL=GNU
else
PARALLEL="moreutils"
fi
else
echo "W: 'parallel' not available, will run sequentially" >&2
echo "W: you may want to install 'parallel' or 'moreutils'" >&2
fi
if [ -n "$PARALLEL" ]; then
if [ "$PARALLEL" = "GNU" ]; then
find . -maxdepth 2 -type d -name .git | \
parallel --will-cite sh -c "GIT_DIR='{}' git gc --quiet"
else
find . -maxdepth 2 -type d -name .git -print0 | \
xargs -r0 parallel -i sh -c "GIT_DIR='{}' git gc --quiet" --
fi
else
All this complexity just because bin:parallel installs an incompatible
executable for this name and diverts it over moreutils' version...
But, there's an even simpler option: use "xargs -P". You even already
have xargs in the code above... As xargs is in an Essential package,
you won't even need any dependency anymore.
Meow!
-- System Information:
Debian Release: buster/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (150, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.18.7+ (SMP w/6 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
More information about the pkg-perl-maintainers
mailing list