diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-04-11 11:02:20 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-04-11 11:05:00 +0100 |
commit | 1265932819df8f3c010d011d13ead6ff59b41e7c (patch) | |
tree | bcdf17cca3b329a2dfb69390eb8ad7b8b38daac1 | |
parent | Run squid pre in foreground (diff) | |
download | util-1265932819df8f3c010d011d13ead6ff59b41e7c.tar.bz2 util-1265932819df8f3c010d011d13ead6ff59b41e7c.tar.xz util-1265932819df8f3c010d011d13ead6ff59b41e7c.zip |
Consider distcc when calculating number of tasks
-rw-r--r-- | bashrc | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -62,7 +62,13 @@ sizes() { PATH="/usr/lib/ccache/bin:$PATH" CORES=$(grep core\ id /proc/cpuinfo | sort -u | wc -l) CPUS=$(grep core\ id /proc/cpuinfo -c) -TASKS=$((($CORES + $CPUS) / 2)) +if [ -n "$DISTCC_HOSTS" ] ; then + TASKS=$(echo $DISTCC_HOSTS | tr ' ' '\n' | cut -d / -f2 | paste -s -d+ | bc) +elif [ -x /usr/bin/distcc ] ; then + TASKS=$(distcc -j) +else + TASKS=$((($CORES + $CPUS) / 2)) +fi export FEATURES="ccache" alias :e="gvim" alias d="cd ~/dev" |