source:
tools/build/push2dist.sh
@
b110bcc
Last change on this file since b110bcc was 7c6b262, checked in by , 4 years ago | |
---|---|
|
|
File size: 787 bytes |
Line | |
---|---|
1 | #!/bin/bash |
2 | |
3 | hash="$1" |
4 | bwlim="$2" |
5 | valid=$(distcc -j 2> /dev/null) |
6 | # if test "${valid}" != 0 |
7 | |
8 | hosts_long=$(distcc --show-hosts 2> /dev/null) |
9 | hosts="localhost" |
10 | while 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 |
18 | done <<< "${hosts_long}" |
19 | |
20 | # echo "Copying to machines : ${hosts} (hash=${hash})" |
21 | |
22 | files="../../../driver/cfa ../../../driver/cfa-cpp ../../../driver/cc1 ../../../driver/as defines.hfa $(find . -name '*.c*' | tr '\n' ' ')" |
23 | # echo "Files ${files}" |
24 | |
25 | function push() { |
26 | ssh ${host} "mkdir -p ~/.cfadistcc/${hash}/" |
27 | rsync --bwlimit=${bwlim} -a ${dV} ${files} ${host}:~/.cfadistcc/${hash}/. |
28 | } |
29 | |
30 | for host in ${hosts} |
31 | do |
32 | push & |
33 | done |
34 | |
35 | wait |
Note: See TracBrowser
for help on using the repository browser.