| #!/usr/bin/env bash |
| |
| # This script checks out all repositories from upstream and pushes master |
| # to the origin repo on Linaro's Git server, rebasing all local branches, |
| # but *not* pushing them, too. |
| |
| . llvm-common |
| |
| function repo_sync () { |
| if [ ! -d $2 ]; then return; fi |
| echo " + Updating $1" |
| cd $2 |
| branch=`get_branch` |
| safe_run git-refresh |
| safe_run git-rebase-all $branch |
| } |
| |
| prog=`basename $0` |
| syntax="Syntax: $prog [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]" |
| rt=false |
| libs=false |
| linker=false |
| debug=false |
| tests=false |
| web=false |
| |
| while getopts "rlkdtwa" opt; do |
| case $opt in |
| r) |
| rt=true |
| ;; |
| l) |
| libs=true |
| ;; |
| k) |
| linker=true |
| ;; |
| d) |
| debug=true |
| ;; |
| t) |
| tests=true |
| ;; |
| w) |
| web=true |
| ;; |
| a) |
| rt=true |
| libs=true |
| linker=true |
| debug=true |
| tests=true |
| ;; |
| *) |
| echo $syntax |
| exit 1 |
| ;; |
| esac |
| done |
| |
| # Compulsory updates |
| repo_sync LLVM $LLVM_SRC |
| repo_sync Clang $LLVM_SRC/../clang |
| |
| # Optional updates |
| if $rt; then |
| repo_sync RT $LLVM_SRC/../compiler-rt |
| fi |
| |
| if $libs; then |
| repo_sync LibC++ $LLVM_SRC/../libcxx |
| repo_sync LibC++ABI $LLVM_SRC/../libcxxabi |
| repo_sync LibUnwind $LLVM_SRC/../libunwind |
| fi |
| |
| if $linker; then |
| repo_sync Linker $LLVM_SRC/../lld |
| fi |
| |
| if $debug; then |
| repo_sync Debugger $LLVM_SRC/../lldb |
| fi |
| |
| if $tests; then |
| repo_sync Test-Suite $LLVM_SRC/../test-suite |
| repo_sync LNT $LLVM_SRC/../lnt |
| repo_sync Zorg $LLVM_SRC/../zorg |
| fi |
| |
| # These are pure SVN repos, not enabled with -a |
| # You have to manually force with -w |
| if $web; then |
| if [ -d $LLVM_SRC/../www ]; then |
| echo " + Updating WWW" |
| cd $LLVM_SRC/../www |
| svn up |
| fi |
| if [ -d $LLVM_SRC/../pubs ]; then |
| echo " + Updating Pubs" |
| cd $LLVM_SRC/../pubs |
| svn up |
| fi |
| fi |