X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=to_ozlabs;h=5666c9f33b27c1b41cabd09e20289a67d161e35d;hb=HEAD;hp=3b15d3e66e2c0c66bce08b3cde68fc22c5fe23a0;hpb=8800026722c76d278d4c0fca908b4690456b1330;p=next-scripts diff --git a/to_ozlabs b/to_ozlabs index 3b15d3e..5666c9f 100755 --- a/to_ozlabs +++ b/to_ozlabs @@ -1,17 +1,23 @@ #!/bin/bash -GIT_REPOS="next next-history.git quilt next-fixes tools etc mmotm" +GIT_REPOS='next next-history.git quilt next-fixes tools etc mmotm' -cd ~/kernels/next +NEXT_DIR="$HOME/kernels/next" -echo "Updating Linus' tree" -ssh ozlabs.org "cd kernels/linus.git; git remote update" +if ! cd "$NEXT_DIR"; then + printf '%s: cannot cd to %s\n' "$0" "$NEXT_DIR" 1>&2 + exit 1 +fi + +printf 'Updating Linus'\'' tree\n' +ssh ozlabs.org 'cd kernels/linus.git; git remote update' for i in $GIT_REPOS; do - echo "Pushing $i" - ( cd $i; git push bilbo ) - [ "${i%.git}" = "$i" ] && - ssh ozlabs.org "cd kernels/next/$i; git reset --hard" + printf 'Pushing %s\n' "$i" + ( cd "$i" && git push --prune bilbo ) + if [ "${i%.git}" = "$i" ]; then + ssh ozlabs.org 'cd kernels/next/'"$i"'; git reset --hard' + fi done { @@ -19,7 +25,6 @@ done - gitk.cache - /merge.debug - /merge.log -- /quilt-import.log - /akpm-import.log - /summ - /patch-*-next-2* @@ -34,11 +39,18 @@ EOF for i in $GIT_REPOS; do echo "- $i/**" done -} | rsync -avHP --include-from - --delete . ozlabs.org:kernels/next/. +} | rsync -avHP --open-noatime --include-from - --delete . ozlabs.org:kernels/next/. -ssh ozlabs.org "touch kernels/NEXT-DONE" +ssh ozlabs.org 'touch kernels/NEXT-DONE' # Fix up the git configs so that the next pushes will work -ssh ozlabs.org 'cd kernels/next; for i in '"$GIT_REPOS"'; do ( cd $i; git config receive.denyCurrentBranch ignore; ); done' +ssh ozlabs.org ' +cd kernels/next +for i in '"$GIT_REPOS"'; do +( + cd $i + git config receive.denyCurrentBranch ignore +) +done' exit 0