summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-04-11 11:02:20 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-04-11 11:05:00 +0100
commit1265932819df8f3c010d011d13ead6ff59b41e7c (patch)
treebcdf17cca3b329a2dfb69390eb8ad7b8b38daac1
parentRun squid pre in foreground (diff)
downloadutil-1265932819df8f3c010d011d13ead6ff59b41e7c.tar.bz2
util-1265932819df8f3c010d011d13ead6ff59b41e7c.tar.xz
util-1265932819df8f3c010d011d13ead6ff59b41e7c.zip
Consider distcc when calculating number of tasks
-rw-r--r--bashrc8
1 files changed, 7 insertions, 1 deletions
diff --git a/bashrc b/bashrc
index 01a8844..64efbbc 100644
--- a/bashrc
+++ b/bashrc
@@ -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"