summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-02-26 00:22:15 -0600
committerSemun Lee <semun.lee@samsung.com>2019-07-03 18:02:10 +0900
commitaf96dbed2efa5596ab01d696a9bc9e911ec193e7 (patch)
tree0b2b130292529391b4df7157d0caed34031cdd77
parent88c24ab04757d0be379739049063547bf5608f80 (diff)
downloadtoybox-af96dbed2efa5596ab01d696a9bc9e911ec193e7.tar.gz
toybox-af96dbed2efa5596ab01d696a9bc9e911ec193e7.tar.bz2
toybox-af96dbed2efa5596ab01d696a9bc9e911ec193e7.zip
Switch to $! for make.sh process enumeration.
-rwxr-xr-xscripts/make.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index 7ebe148..6c03b80 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -245,17 +245,17 @@ do
LFILES="$LFILES $OUT"
[ "$OUT" -nt "$i" ] && continue
do_loudly $BUILD -c $i -o $OUT &
+ PENDING="$PENDING $!"
# ratelimit to $CPUS many parallel jobs, detecting errors
while true
do
- PENDING="$(echo $PENDING $(jobs -rp) | tr ' ' '\n' | sort -u)"
- [ $(echo -n "$PENDING" | wc -l) -lt "$CPUS" ] && break;
+ [ $(echo "$PENDING" | wc -w) -lt "$CPUS" ] && break;
- wait $(echo "$PENDING" | head -n 1)
+ wait $(echo "$PENDING" | awk '{print $1}')
DONE=$(($DONE+$?))
- PENDING="$(echo "$PENDING" | tail -n +2)"
+ PENDING="$(echo "$PENDING" | sed 's/^ *[0-9]*//')"
done
[ $DONE -ne 0 ] && break
done