3 LOG_FILE="../merge.log"
5 build_dir="/scratch/sfr/next"
6 build_cmd="bin/build_next"
13 [ -n "$1" ] && build_host="$1"
15 cp /dev/null $LOG_FILE
19 echo "$@" | tee -a $LOG_FILE
25 $@ 2>&1 | tee -a $LOG_FILE
26 return ${PIPESTATUS[0]}
29 execute git checkout master
30 execute git reset --hard stable
32 heads=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
38 [ "$tree" == "quilt" ] && tree=${h#quilt/}
40 old_head=$(git rev-parse HEAD)
41 execute git merge $h || {
42 echo Merge failed 1>&2
44 GIT_EDITOR=: execute git commit -v -a
45 execute git diff -M --stat --summary 'HEAD^..'
49 # See if we need to build after merging this tree
50 new_head=$(git rev-parse HEAD)
51 [ "$old_head" = "$new_head" ] ||
54 [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] ||
59 do_build=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'$tree'" { print $6; }')
60 [ "$do_build" = "yes" ] ||
62 rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
63 echo Rsync failed 1>&2
66 ssh "$build_host" "$build_cmd" || {
67 echo Build failed 1>&2