]> git.ozlabs.org Git - next-scripts/blobdiff - to_ozlabs
to_build_host: provide some protection against misrunning
[next-scripts] / to_ozlabs
index a4f682a03dbc16b982a2efd3242949513a9f0f8e..268c09ed4ab7434891b4fcfaddebe12ded43dc55 100755 (executable)
--- a/to_ozlabs
+++ b/to_ozlabs
@@ -1,30 +1,44 @@
 #!/bin/bash
 
-echo "Updating Linus' tree"
-ssh ozlabs.org "cd kernels/linus.git; git remote update"
-
-echo "Pushing next"
-cd ~/kernels/next/next
-git push bilbo
-ssh ozlabs.org "cd kernels/next/next; git reset --hard"
-
-echo "Pushing next-history"
-cd ~/kernels/next/next-history.git
-git push bilbo
+GIT_REPOS="next next-history.git quilt next-fixes tools etc mmotm"
 
-echo "Pushing quilt"
-cd ~/kernels/next/quilt
-git push bilbo
-ssh ozlabs.org "cd kernels/next/quilt; git reset --hard"
+cd ~/kernels/next
 
-echo "Pushing next-fixes"
-cd ~/kernels/next/next-fixes
-git push bilbo
-ssh ozlabs.org "cd kernels/next/next-fixes; git reset --hard"
+echo "Updating Linus' tree"
+ssh ozlabs.org "cd kernels/linus.git; git remote update"
 
-cd ../../
-rsync -avHP --exclude gitk.cache --exclude 'patch-*-next-2*' --exclude next-2'*'/ --exclude next/'**' --exclude quilt/'**' --exclude next-fixes/'**' --exclude next-history.git/'**' --delete next/ ozlabs.org:kernels/next/
+for i in $GIT_REPOS; do
+       echo "Pushing $i"
+       ( cd $i; git push --prune bilbo )
+       [ "${i%.git}" = "$i" ] &&
+               ssh ozlabs.org "cd kernels/next/$i; git reset --hard"
+done
+
+{
+       cat <<EOF
+- gitk.cache
+- /merge.debug
+- /merge.log
+- /quilt-import.log
+- /akpm-import.log
+- /summ
+- /patch-*-next-2*
+- /next-2*/
++ .git/
++ .git/config
++ .git/hooks
++ .git/hooks/**
++ /next/.git/rr-cache/
++ /next/.git/rr-cache/**
+EOF
+       for i in $GIT_REPOS; do
+               echo "- $i/**"
+       done
+} | rsync -avHP --include-from - --delete . ozlabs.org:kernels/next/.
 
 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'
+
 exit 0