Commit 7f946abe authored by gregor herrmann's avatar gregor herrmann

dpt-gc: use xargs' -P instead of parallel (from moreutils or parallel)

and drop parallel from Suggests (moreutils is still used in other places).

Thanks: Adam Borowski for the bug report.
Closes: #908844
parent 157b21e2
......@@ -90,7 +90,6 @@ Suggests: bc,
cdbs,
duck,
moreutils,
parallel,
perl-depends,
python3,
python3-launchpadlib
......
......@@ -25,18 +25,7 @@ while getopts vshp opt; do
echo "W: 'bc' not available, stats will use byte units" >&2
fi
;;
p)
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
;;
p) PARALLEL=1;;
v) VERBOSE=1;;
?) usage;;
esac
......@@ -83,13 +72,8 @@ if [ -n "$STATS" ]; then
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
find . -maxdepth 2 -type d -name .git -print0 | \
xargs -r0 -P $(nproc) -I '{}' sh -c "GIT_DIR='{}' git gc --quiet"
else
for d in `find . -maxdepth 1 -type d`; do
[ -d "$d/.git" ] || continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment