From a1da89c3815d37ec96fc9f298560852b2231e853 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 26 Aug 2015 17:10:33 +1000 Subject: [PATCH] cope with doing the merges and build on the same machine --- common.sh | 7 +++++-- do_build | 7 +++++-- do_last_build | 10 ++++++---- do_merge | 2 +- do_patch | 2 +- do_push | 2 +- do_revert | 2 +- merge_akpm | 4 ++-- merge_fix | 2 +- merge_old_version | 2 +- setup_build | 5 ++++- 11 files changed, 28 insertions(+), 17 deletions(-) diff --git a/common.sh b/common.sh index f411848..e3e2209 100644 --- a/common.sh +++ b/common.sh @@ -19,7 +19,10 @@ j_factor=48 ssh_key_file=~/.ssh/ra.kernel.org gpg_key=41D5C07A -[ "$NEXT_BUILD_HOST" ] && build_host="$NEXT_BUILD_HOST" +[ "$NEXT_BUILD_HOST" ] && { + build_host="$NEXT_BUILD_HOST" + [ "$build_host" = "none" ] && build_host="" +} [ "$NEXT_BUILD_DIR" ] && build_dir="$NEXT_BUILD_DIR" [ "$NEXT_GCC_VERSION" ] && gcc_version="$NEXT_GCC_VERSION" [ "$NEXT_J_FACTOR" ] && j_factor="$NEXT_J_FACTOR" @@ -33,7 +36,7 @@ gpg_key=41D5C07A shift } -export NEXT_BUILD_HOST="$build_host" +export NEXT_BUILD_HOST="${build_host:-none}" export NEXT_BUILD_DIR="$build_dir" export NEXT_GCC_VERSION="$gcc_version" export NEXT_J_FACTOR="$j_factor" diff --git a/do_build b/do_build index b9dfd96..0cb1251 100755 --- a/do_build +++ b/do_build @@ -4,8 +4,11 @@ set -e -###ssh "$build_host" /bin/sh -e <<-EOF -ssh root@"$build_host" unshare -n su $(id -u -n) <<-EOF +cmd="/bin/sh" +[ "$build_host" ] && + cmd="ssh root@$build_host unshare -n su $(id -u -n)" + +$cmd <<-EOF echo Building on \$(hostname) diff --git a/do_last_build b/do_last_build index 5f039e4..244b2a3 100755 --- a/do_last_build +++ b/do_last_build @@ -4,8 +4,11 @@ set -e -##ssh "$build_host" /bin/sh -e <<-EOF -ssh root@"$build_host" unshare -n su $(id -u -n) <<-EOF +cmd="/bin/sh" +[ "$build_host" ] && + cmd="ssh root@$build_host unshare -n su $(id -u -n)" + +$cmd <<-EOF set -e echo \$PATH | grep -q "\$HOME/bin" || export PATH="\$HOME/bin:\$PATH" @@ -54,8 +57,7 @@ do ka=${a%:*} ca=${a#*:} d=../${ka}_defconfig - ##ssh "$build_host" /bin/sh -e <<-EOF - ssh root@"$build_host" unshare -n su $(id -u -n) <<-EOF + $cmd <<-EOF set -e echo \$PATH | grep -q "\$HOME/bin" || diff --git a/do_merge b/do_merge index 10ba5cf..a3df8e5 100755 --- a/do_merge +++ b/do_merge @@ -176,7 +176,7 @@ for h in $heads; do do_build=$(grep -v '^#' $CTRL_FILE | awk -F ' ' '$3=="'$tree'" { print $6; }') [ "$do_build" = "yes" ] || continue - git push -f "$build_host":"$build_dir" master:refs/heads/next || { + git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 notify-send -t 0 -u critical "linux-next push failed for $tree!" pushover "linux-next push failed for $tree!" diff --git a/do_patch b/do_patch index c48dcb2..e886e2a 100755 --- a/do_patch +++ b/do_patch @@ -27,7 +27,7 @@ GIT_EDITOR=: execute git am -3 "$patch" || exit 1 $no_build && exit 0 -git push -f "$build_host":"$build_dir" master:refs/heads/next || { +git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 bash -i || exit } diff --git a/do_push b/do_push index b520cfd..46dec18 100755 --- a/do_push +++ b/do_push @@ -2,6 +2,6 @@ . "$(dirname $0)/common.sh" -git push -f "$build_host":"$build_dir" master:refs/heads/next +git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next exit $? diff --git a/do_revert b/do_revert index d5e585d..f56960a 100755 --- a/do_revert +++ b/do_revert @@ -28,7 +28,7 @@ GIT_EDITOR=: execute git revert $rev || exit 1 $no_build && exit 0 -git push -f "$build_host":"$build_dir" master:refs/heads/next || { +git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 bash -i || exit } diff --git a/merge_akpm b/merge_akpm index 6f3f070..f3181dd 100755 --- a/merge_akpm +++ b/merge_akpm @@ -64,7 +64,7 @@ $no_build || [ "$old_head" = "$new_head" ] || [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] || { - git push -f "$build_host":"$build_dir" master:refs/heads/next || { + git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 bash -i || exit } @@ -123,7 +123,7 @@ $no_build || [ "$old_head" = "$new_head" ] || [ "$(git diff ${old_head}.. | wc -c)" -eq 0 ] || { - git push -f "$build_host":"$build_dir" master:refs/heads/next || { + git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 bash -i || exit } diff --git a/merge_fix b/merge_fix index 7e6ff2b..9048251 100755 --- a/merge_fix +++ b/merge_fix @@ -56,7 +56,7 @@ GIT_EDITOR=: execute git commit -v -a --amend || { $no_build && exit 0 -git push -f "$build_host":"$build_dir" master:refs/heads/next || { +git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 bash -i || exit } diff --git a/merge_old_version b/merge_old_version index 5465ab5..99ffa84 100755 --- a/merge_old_version +++ b/merge_old_version @@ -95,7 +95,7 @@ printf "%s$tab%s\n" $tree $rev >>$SHA1_FILE $no_build && exit 0 -git push -f "$build_host":"$build_dir" master:refs/heads/next || { +git push -f "${build_host}${build_host:+:}${build_dir}" master:refs/heads/next || { echo git push failed 1>&2 bash -i || exit } diff --git a/setup_build b/setup_build index 26d511a..5650368 100755 --- a/setup_build +++ b/setup_build @@ -2,7 +2,10 @@ . "$(dirname $0)/common.sh" -ssh "$build_host" /bin/sh <