diff --git a/include/option.sh b/include/option.sh index 45b6f67..7348b76 100755 --- a/include/option.sh +++ b/include/option.sh @@ -15,13 +15,14 @@ tmpgit="${PWD}/tmp/gitclone" eval "$(setvars "" board boarddir)" threads= -set | grep CBMK_THREADS 1>/dev/null 2>/dev/null || threads=$(nproc) || : -[ -z "$threads" ] && threads=$CBMK_THREADS -[ -z "$threads" ] && threads=1 # CBMK_THREADS not set, and nproc failed +set | grep CBMK_THREADS 1>/dev/null 2>/dev/null && threads="$CBMK_THREADS" +[ -z "$threads" ] && threads=1 expr "X$threads" : "X-\{0,1\}[0123456789][0123456789]*$" \ 1>/dev/null 2>/dev/null || threads=1 # user specified a non-integer +export CBMK_THREADS="$threads" + items() { rval=1