mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
common: Make sure that NUM_JOBS is a positive integer
This commit is contained in:
parent
6ed7cd66d5
commit
a6a6e0be2c
@ -8,7 +8,10 @@
|
||||
|
||||
# The number of jobs to pass to tools that can run in parallel (such as make
|
||||
# and dpkg-buildpackage
|
||||
if [[ -z ${NUM_JOBS} ]]; then
|
||||
case "${NUM_JOBS}" in
|
||||
*[!0-9]*) NUM_JOBS='' ;;
|
||||
esac
|
||||
if [[ -z ${NUM_JOBS} ]] || [[ ${NUM_JOBS} -eq 0 ]]; then
|
||||
NUM_JOBS=$(grep -c "^processor" /proc/cpuinfo)
|
||||
fi
|
||||
# Ensure that any sub scripts we invoke get the max proc count.
|
||||
|
Loading…
x
Reference in New Issue
Block a user