More parallel build tweaks.
authorRob Landley <rob@landley.net>
Mon, 1 Sep 2014 03:07:43 +0000 (22:07 -0500)
committerRob Landley <rob@landley.net>
Mon, 1 Sep 2014 03:07:43 +0000 (22:07 -0500)
echo "$PENDING" needs the quotes to avoid gluing the lines together, which
prevents wc -l or head -n +2 from working right.

scripts/make.sh

index 42143f8..23e4a9b 100755 (executable)
@@ -199,9 +199,9 @@ do
   while true
   do
     PENDING="$(echo $PENDING $(jobs -rp) | tr ' ' '\n' | sort -u)"
-    [ $(echo $PENDING | wc -l) -lt "$CPUS" ] && break;
+    [ $(echo "$PENDING" | wc -l) -lt "$CPUS" ] && break;
 
-    wait $(echo $PENDING | head -n 1) || exit 1
+    wait $(echo "$PENDING" | head -n 1) || exit 1
     PENDING="$(echo "$PENDING" | tail -n +2)"
   done
 done