Obfuscate RCS ID matching so that CVS doesn't expand it.
[netbsd-mini2440.git] / dist / ntp / flock-build
blobd80fc6d3d48cea3ea3d959342b620952fe88f1fe
1 #! /bin/sh
3 BUILD_ARGS="$@"
4 PARSE="--enable-parse-clocks"
5 #PARSE=
6 STD="--enable-simulator"
8 case "$SIMUL" in
9 '') PARALLEL_BUILDS=1
11 *) PARALLEL_BUILDS=$SIMUL
12 esac
14 case "$PARALLEL_BUILDS" in
15 1) ;;
16 *) echo Launching $PARALLEL_BUILDS parallel builds on each machine
17 esac
19 # Backroom:
20 # barnstable freebsd-6.1
21 # beauregard freebsd-6.0
22 # X churchy alpha-dec-osf5.1
23 # deacon sparc-sun-solaris2.10
24 # grundoon freebsd-6.2
25 # howland freebsd-6.1
26 # o macabre freebsd-6.1-STABLE
27 # o mort freebsd-6.1
28 # whimsy sparc-sun-solaris2.10
30 # Campus:
31 # * baldwin sparc-sun-solaris2.10
32 # * bridgeport sparc-sun-solaris2.10
33 # * cowbird freebsd-6.1
34 # * malarky sparc-sun-solaris2.10
35 # * pogo sparc-sun-solaris2.10
36 # * rackety freebsd-6.1
38 # HMS: we need $PWD because solaris produces /deacon/backroom when
39 # we are in /backroom and in general there is no /deacon/backroom.
40 c_d=${PWD:-`pwd`}
42 SIG=`perl -e 'print rand'`
44 case "$LIST" in
45 '') LIST="baldwin bridgeport cowbird malarky pogo rackety" ;;
46 esac
48 for i in $LIST
50 SKIPTHIS=0
51 [ -f .buildkey-$i ] && SKIPTHIS=1
52 case "$SKIPTHIS" in
54 echo flock-build running on $i? check LIST, skipping
56 0)
57 echo $i
58 echo $SIG > .buildkey-$i
59 case "1" in
61 ssh $i "cd $c_d ; ./build $SIG $PARSE $STD $BUILD_ARGS" &
62 ssh $i "cd $c_d ; ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS" &
63 ssh $i "cd $c_d ; ./build $SIG $STD --disable-all-clocks $BUILD_ARGS" &
66 cat > .flockbuild-$i-$SIG <<ENDQUOT
67 #!/bin/sh
69 # depends on job control and expects to be invoked under ssh -tt
71 cd $c_d
72 COUNT=0
74 ./build $SIG $PARSE $STD $BUILD_ARGS &
76 COUNT=\`expr \$COUNT + 1\`
77 echo $i started build \$COUNT of 4
78 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
80 ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS &
82 COUNT=\`expr \$COUNT + 1\`
83 echo $i started build \$COUNT of 4
84 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
86 ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS &
88 COUNT=\`expr \$COUNT + 1\`
89 echo $i started build \$COUNT of 4
90 [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait
92 ./build $SIG $STD --disable-all-clocks $BUILD_ARGS &
94 COUNT=\`expr \$COUNT + 1\`
95 echo $i started build \$COUNT of 4
96 wait
97 echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done.
98 rm .buildkey-$i
99 ENDQUOT
100 chmod +x .flockbuild-$i-$SIG
101 ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \
102 rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null &
103 esac
104 esac
105 done
106 echo `date -u '+%H:%M:%S'` flock-build launched