Sanity check for number of parallel jobs.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2015-10-30 13:53:53 -07:00
parent 263e8026ec
commit f849505ac9

View File

@ -516,7 +516,12 @@ if [ -z "${CT_RESTART}" ]; then
# And help make go faster
JOBSFLAGS=
# Override the configured jobs with what's been given on the command line
[ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}"
if [ -n "${CT_JOBS}" ]; then
if [ ! -z "`echo "${CT_JOBS}" | sed 's/[0-9]//g'`" ]; then
CT_Abort "Number of parallel jobs must be integer."
fi
CT_PARALLEL_JOBS="${CT_JOBS}"
fi
# Use the number of processors+1 when automatically setting the number of
# parallel jobs. Fall back to 1 if the host doesn't use GLIBC.
AUTO_JOBS=$((`getconf _NPROCESSORS_ONLN 2> /dev/null || echo 0` + 1))