blob: d3e1434cce8b9c98dafa11d9e7129b2ecf3b99e5 [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 () {
Diana Picus09cd9b62016-04-25 18:04:06 +030010 if [ ! -d $2 ]; then
11 echo " + Not updating $1 (couldn't find source directory)"
12 return;
13 fi
Renato Golin94cc1042016-04-26 11:02:23 +010014 echo " + Updating $1"
15 cd $2
16 branch=`get_branch`
17 safe_run git-refresh
18 safe_run git-rebase-all $branch
19}
20
21prog=`basename $0`
22syntax="Syntax: $prog [-compiler(r)T] [-(l)ibs] [-Lin(k)er] [-(d)ebugger] [-(t)ests] [-(w)eb pages] [-(a)ll]"
23rt=false
24libs=false
25linker=false
26debug=false
27tests=false
28web=false
29
30while getopts "rlkdtwa" opt; do
31 case $opt in
32 r)
33 rt=true
34 ;;
35 l)
36 libs=true
37 ;;
38 k)
39 linker=true
40 ;;
41 d)
42 debug=true
43 ;;
44 t)
45 tests=true
46 ;;
47 w)
48 web=true
49 ;;
50 a)
51 rt=true
52 libs=true
53 linker=true
54 debug=true
55 tests=true
56 ;;
57 *)
58 echo $syntax
59 exit 1
60 ;;
61 esac
62done
63
64# Compulsory updates
65repo_sync LLVM $LLVM_SRC
66repo_sync Clang $LLVM_SRC/../clang
67
68# Optional updates
69if $rt; then
70 repo_sync RT $LLVM_SRC/../compiler-rt
71fi
72
73if $libs; then
74 repo_sync LibC++ $LLVM_SRC/../libcxx
75 repo_sync LibC++ABI $LLVM_SRC/../libcxxabi
76 repo_sync LibUnwind $LLVM_SRC/../libunwind
77fi
78
79if $linker; then
80 repo_sync Linker $LLVM_SRC/../lld
81fi
82
83if $debug; then
84 repo_sync Debugger $LLVM_SRC/../lldb
85fi
86
87if $tests; then
88 repo_sync Test-Suite $LLVM_SRC/../test-suite
89 repo_sync LNT $LLVM_SRC/../lnt
90 repo_sync Zorg $LLVM_SRC/../zorg
91fi
92
93# These are pure SVN repos, not enabled with -a
94# You have to manually force with -w
95if $web; then
96 if [ -d $LLVM_SRC/../www ]; then
97 echo " + Updating WWW"
98 cd $LLVM_SRC/../www
99 svn up
100 fi
101 if [ -d $LLVM_SRC/../pubs ]; then
102 echo " + Updating Pubs"
103 cd $LLVM_SRC/../pubs
104 svn up
105 fi
106fi