source: tools/build/push2dist.sh

Last change on this file was 7c6b262, checked in by Thierry Delisle <tdelisle@…>, 19 months ago

Added option to limit bandwith during the distribution phase of th build (when using distcc)

  • Property mode set to 100755
File size: 787 bytes
Line 
1#!/bin/bash
2
3hash="$1"
4bwlim="$2"
5valid=$(distcc -j 2> /dev/null)
6# if test "${valid}" != 0
7
8hosts_long=$(distcc --show-hosts 2> /dev/null)
9hosts="localhost"
10while read -r host; do
11        if [[ "${host}" =~ @?([A-Za-z0-9.\-]+)/.* ]]
12        then
13                hosts="${BASH_REMATCH[1]} ${hosts}"
14        else
15                >&2 echo "Could not parse host '${host}' (must use ssh hosts)"
16                exit 1
17        fi
18done <<< "${hosts_long}"
19
20# echo "Copying to machines : ${hosts} (hash=${hash})"
21
22files="../../../driver/cfa ../../../driver/cfa-cpp ../../../driver/cc1 ../../../driver/as defines.hfa $(find . -name '*.c*' | tr '\n' ' ')"
23# echo "Files ${files}"
24
25function push() {
26        ssh ${host} "mkdir -p ~/.cfadistcc/${hash}/"
27        rsync --bwlimit=${bwlim} -a ${dV} ${files} ${host}:~/.cfadistcc/${hash}/.
28}
29
30for host in ${hosts}
31do
32        push &
33done
34
35wait
Note: See TracBrowser for help on using the repository browser.