3 LOG_FILE="../merge.log"
5 build_dir="/scratch/sfr/next"
6 build_cmd="bin/build_next"
8 today="$(date '+%Y%m%d')"
11 [ "$NEXT_BUILD_HOST" ] && build_host="$NEXT_BUILD_HOST"
12 [ "$NEXT_BUILD_DIR" ] && build_host="$NEXT_BUILD_DIR"
29 echo "$@" | tee -a $LOG_FILE
35 $@ 2>&1 | tee -a $LOG_FILE
36 return ${PIPESTATUS[0]}
41 execute git clone -s -l -n -q . ../rebase-tmp || {
42 echo Clone failed 1>&2
45 log '$' cd ../rebase-tmp
47 execute git fetch --no-tags $cpwd refs/heads/quilt/akpm:akpm || {
48 echo Fetch of top failed 1>&2
51 execute git fetch --no-tags $cpwd refs/heads/quilt/akpm-base:akpm-base || {
52 echo Fetch of base failed 1>&2
55 execute git checkout akpm || {
56 echo Checkout of top failed 1>&2
59 execute git rebase --onto master akpm-base || {
60 echo Rebase failed 1>&2
63 echo "fix up? use git rebase -i --onto master akpm-base"
67 execute git fetch -f ../rebase-tmp akpm:quilt/akpm || {
71 execute rm -rf ../rebase-tmp
73 git update-ref "refs/next/$today/akpm" quilt/akpm
74 git update-ref refs/heads/quilt/akpm-base HEAD
76 log Merging quilt/akpm '('$(git log -1 --oneline quilt/akpm)')'
77 execute git merge --no-ff quilt/akpm || {
78 echo Merge failed 1>&2
82 [ -f "../merge-fixes/akpm" ] && {
83 for p in $(cat "../merge-fixes/akpm"); do
84 ../tools/merge_fix -n "$p" || {
89 [ -x "../pre-build/akpm" ] && {
90 "../pre-build/akpm" || bash -i || exit
95 git push -f "$build_host":"$build_dir" master:refs/heads/next || {
96 echo git push failed 1>&2
99 ssh "$build_host" "$build_cmd" || {
100 echo Build failed 1>&2