]> git.ozlabs.org Git - next-scripts/commitdiff
cope with doing the merges and build on the same machine
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 26 Aug 2015 07:10:33 +0000 (17:10 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 26 Aug 2015 07:10:33 +0000 (17:10 +1000)
common.sh
do_build
do_last_build
do_merge
do_patch
do_push
do_revert
merge_akpm
merge_fix
merge_old_version
setup_build

index f4118484cd5dbe5996cf68c11b237524559a4a8b..e3e220925fc2e219772e35b8f3cffa7a4948b32a 100644 (file)
--- 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"
index b9dfd96fec1120ed7e1ba3f2539ba20af1b67855..0cb125148fcd4bef5bd141a31923bcb02e7cfc28 100755 (executable)
--- 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)
 
index 5f039e44c310181f0526ef8441fae7608fd7a65d..244b2a365adee195a7771017ae73343cc1edc7cf 100755 (executable)
@@ -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" ||
index 10ba5cf33c8e7964a72596164aa6aad6b351793f..a3df8e5784ff976d4bee759bac91757c9e581cd3 100755 (executable)
--- 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!"
index c48dcb23ddd57e1dfab0e3101ca1391e4df48bbb..e886e2a3e214f11ddc32f68bd99aa16dea84b301 100755 (executable)
--- 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 b520cfd91e9f1b750d7199054390f3284209f596..46dec189fc287beb5e95a4b0f5f05ad29c1f0775 100755 (executable)
--- 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 $?
index d5e585dd3cc2a61e97f7c4091251f445fc0ac55d..f56960a6288c8c3eda81b732c5eca9cc911e02c9 100755 (executable)
--- 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
 }
index 6f3f0705efd4b496f1abe26b0fef2ede82aa6c5e..f3181dd0b6d1b87452de8a0480adc6eb63c27fb5 100755 (executable)
@@ -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
        }
index 7e6ff2b366efd5b640ef1251e88d88b0af65f387..9048251a23ab422c5be3df87d12c2a6ce82c36c5 100755 (executable)
--- 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
 }
index 5465ab51028a352fdb31e190026743e56ae41512..99ffa84f2cb164af13015aaff121539856326e80 100755 (executable)
@@ -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
 }
index 26d511af0e33e6409a38cc646d211827f07f7187..56503689245ec6768f613f8996b66077aaca7037 100755 (executable)
@@ -2,7 +2,10 @@
 
 . "$(dirname $0)/common.sh"
 
-ssh "$build_host" /bin/sh <<EOF
+cmd=
+[ "$build_host" ] &&
+       cmd="ssh $build_host"
+$cmd /bin/sh <<EOF
        set -x -e
        [ -d "$build_dir" ] || mkdir -p "$build_dir"
        cd "$build_dir/.."