blob: bd46404e3c521f68b2fb68e4354ada0981578f73 [file] [log] [blame]
Renato Golin94cc1042016-04-26 11:02:23 +01001#!/usr/bin/env bash
2
3# This script checks out all repositories from upstream and pushes master
4# to the origin repo on Linaro's Git server, rebasing all local branches,
5# but *not* pushing them, too.
6
7. llvm-common
8
9function repo_sync () {
10 if [ ! -d $2 ]; then return; fi
11 echo " + Updating $1"
12 cd $2
13 branch=`get_branch`
14 safe_run git-refresh
15 safe_run git-rebase-all $branch
16}
17
18prog=`basename $0`
19syntax="Syntax: $prog [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]"
20rt=false
21libs=false
22linker=false
23debug=false
24tests=false
25web=false
26
27while getopts "rlkdtwa" opt; do
28 case $opt in
29 r)
30 rt=true
31 ;;
32 l)
33 libs=true
34 ;;
35 k)
36 linker=true
37 ;;
38 d)
39 debug=true
40 ;;
41 t)
42 tests=true
43 ;;
44 w)
45 web=true
46 ;;
47 a)
48 rt=true
49 libs=true
50 linker=true
51 debug=true
52 tests=true
53 ;;
54 *)
55 echo $syntax
56 exit 1
57 ;;
58 esac
59done
60
61# Compulsory updates
62repo_sync LLVM $LLVM_SRC
63repo_sync Clang $LLVM_SRC/../clang
64
65# Optional updates
66if $rt; then
67 repo_sync RT $LLVM_SRC/../compiler-rt
68fi
69
70if $libs; then
71 repo_sync LibC++ $LLVM_SRC/../libcxx
72 repo_sync LibC++ABI $LLVM_SRC/../libcxxabi
73 repo_sync LibUnwind $LLVM_SRC/../libunwind
74fi
75
76if $linker; then
77 repo_sync Linker $LLVM_SRC/../lld
78fi
79
80if $debug; then
81 repo_sync Debugger $LLVM_SRC/../lldb
82fi
83
84if $tests; then
85 repo_sync Test-Suite $LLVM_SRC/../test-suite
86 repo_sync LNT $LLVM_SRC/../lnt
87 repo_sync Zorg $LLVM_SRC/../zorg
88fi
89
90# These are pure SVN repos, not enabled with -a
91# You have to manually force with -w
92if $web; then
93 if [ -d $LLVM_SRC/../www ]; then
94 echo " + Updating WWW"
95 cd $LLVM_SRC/../www
96 svn up
97 fi
98 if [ -d $LLVM_SRC/../pubs ]; then
99 echo " + Updating Pubs"
100 cd $LLVM_SRC/../pubs
101 svn up
102 fi
103fi