aboutsummaryrefslogtreecommitdiff
path: root/helpers/llvm-sync
diff options
context:
space:
mode:
authorRenato Golin <rengolin@gmail.com>2016-04-26 11:02:23 +0100
committerRenato Golin <rengolin@gmail.com>2016-04-26 11:02:23 +0100
commit94cc104f044261f74fbff3ff587855df1a05f64d (patch)
tree7c6664fdf7e7fab54fea926b1fc6196a09b6540f /helpers/llvm-sync
Initial Commit, moving from dev-private and removing private stuff
Diffstat (limited to 'helpers/llvm-sync')
-rwxr-xr-xhelpers/llvm-sync103
1 files changed, 103 insertions, 0 deletions
diff --git a/helpers/llvm-sync b/helpers/llvm-sync
new file mode 100755
index 0000000..bd46404
--- /dev/null
+++ b/helpers/llvm-sync
@@ -0,0 +1,103 @@
+#!/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