(travis) Refactor the NUMTHREADS codepaths, rename variable (see next commit)
[dbsrgits/DBIx-Class-Historic.git] / maint / travis-ci_scripts / 10_before_install.bash
index 9f0e3e5..53ff95c 100755 (executable)
@@ -40,8 +40,10 @@ if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then return ; fi
 #
 # We also divide the result by a factor, otherwise the travis VM gets
 # overloaded (the amount of available swap is just TOOOO damn small)
-if [[ -z "$NUMTHREADS" ]] ; then
-  export NUMTHREADS="$(( ( $(perl -0777 -n -e 'print (/ (?: .+ ^ processor \s+ : \s+ (\d+) ) (?! ^ processor ) /smx)' < /proc/cpuinfo) + 1 ) / 3 ))"
+export VCPU_AVAILABLE="$(( ( $(perl -0777 -n -e 'print (/ (?: .+ ^ processor \s+ : \s+ (\d+) ) (?! ^ processor ) /smx)' < /proc/cpuinfo) + 1 ) / 3 ))"
+
+if [[ -z "$VCPU_USE" ]] ; then
+  export VCPU_USE="$VCPU_AVAILABLE"
 fi
 
 export CACHE_DIR="/tmp/poormanscache"