From f849505ac94a3f616fc3af243f50be42409335ca Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 30 Oct 2015 13:53:53 -0700 Subject: Sanity check for number of parallel jobs. Signed-off-by: Alexey Neyman diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index e29dea5..a3514cb 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -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)) -- cgit v0.10.2-6-g49f6