3 LOG_FILE="../merge.log"
5 build_dir="/scratch/sfr/next"
6 build_cmd="bin/build_next"
18 [ -z "$start_from" ] && {
19 echo "-s requires a start tree" 1>&2
24 [ -n "$1" ] && build_host="$1"
28 echo "$@" | tee -a $LOG_FILE
34 $@ 2>&1 | tee -a $LOG_FILE
35 return ${PIPESTATUS[0]}
38 [ -n "$start_from" ] || {
39 cp /dev/null $LOG_FILE
40 execute git checkout master
41 execute git reset --hard stable
44 heads=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
50 [ "$tree" == "quilt" ] && tree=${h#quilt/}
52 [ -n "$start_from" ] && {
53 if [ "$tree" = "$start_from" ]; then
61 old_head=$(git rev-parse HEAD)
62 execute git merge $h || {
63 echo Merge failed 1>&2
65 GIT_EDITOR=: execute git commit -v -a
66 execute git diff -M --stat --summary 'HEAD^..'
70 # See if we need to build after merging this tree
71 new_head=$(git rev-parse HEAD)
72 [ "$old_head" = "$new_head" ] ||
75 [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] ||
80 do_build=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'$tree'" { print $6; }')
81 [ "$do_build" = "yes" ] ||
83 rsync -avH --exclude .git --delete . "$build_host":"$build_dir"/. || {
84 echo Rsync failed 1>&2
87 ssh "$build_host" "$build_cmd" || {
88 echo Build failed 1>&2