mprsyncup: Wait on all children instead of listing them

POSIX shell doesn't understand arrays. We can avoid them by waiting on
all child processes instead of collecting their PIDs.
This commit is contained in:
Lawrence Velázquez
2016-11-24 23:50:47 -05:00
parent ce3105f77c
commit bfa5423746
+1 -5
View File
@@ -174,18 +174,14 @@ if [ "${PORTS_CHANGED}" -eq 1 ]; then
(
# generate platform-specific indexes
cd "${PORTS}"
PIDS=()
# Intentionally split PLATFORMS on whitespace.
for PLATFORM in $PLATFORMS; do
INDEX="PortIndex_darwin_${PLATFORM}"
${PORTINDEX} -p "macosx_${PLATFORM}" -o "${INDEX}" \
| ${AWK} '{ print "Updating " idx ":\t" $0 }' idx="$INDEX" \
| expand -t 40,48,56,64,72,80 &
PIDS+=($!)
done
for PID in ${PIDS[*]}; do
wait ${PID}
done
wait
)
fi