blob: 2fd4206b740621235b9d5c65331feb6af32ba6cb [file] [log] [blame]
Bill Wendlingee30e832013-06-07 11:15:30 +00001#!/bin/sh
2#===-- tag.sh - Tag the LLVM release candidates ----------------------------===#
3#
4# The LLVM Compiler Infrastructure
5#
6# This file is distributed under the University of Illinois Open Source
7# License.
8#
9#===------------------------------------------------------------------------===#
10#
11# Create branches and release candidates for the LLVM release.
12#
13#===------------------------------------------------------------------------===#
14
15set -e
16
Hans Wennborgcfb85e02015-07-17 16:49:59 +000017projects="llvm cfe test-suite compiler-rt libcxx libcxxabi clang-tools-extra polly lldb lld openmp libunwind"
Bill Wendlingee30e832013-06-07 11:15:30 +000018base_url="https://llvm.org/svn/llvm-project"
19
20release=""
21rc=""
22
23function usage() {
24 echo "Export the SVN sources and build tarballs from them"
25 echo "usage: `basename $0`"
26 echo " "
27 echo " -release <num> The version number of the release"
28 echo " -rc <num> The release candidate number"
29 echo " -final The final tag"
30}
31
32function export_sources() {
33 release_no_dot=`echo $release | sed -e 's,\.,,g'`
34 tag_dir="tags/RELEASE_$release_no_dot/$rc"
35
36 if [ "$rc" = "final" ]; then
37 rc=""
38 fi
39
40 for proj in $projects; do
41 echo "Exporting $proj ..."
42 svn export \
43 $base_url/$proj/$tag_dir \
44 $proj-$release$rc.src
45
46 echo "Creating tarball ..."
Bill Wendling24c6f572014-08-26 08:11:22 +000047 tar cfJ $proj-$release$rc.src.tar.xz $proj-$release$rc.src
Bill Wendlingee30e832013-06-07 11:15:30 +000048 done
49}
50
51while [ $# -gt 0 ]; do
52 case $1 in
53 -release | --release )
54 shift
55 release=$1
56 ;;
57 -rc | --rc )
58 shift
59 rc="rc$1"
60 ;;
61 -final | --final )
62 rc="final"
63 ;;
64 -h | -help | --help )
65 usage
66 exit 0
67 ;;
68 * )
69 echo "unknown option: $1"
70 usage
71 exit 1
72 ;;
73 esac
74 shift
75done
76
77if [ "x$release" = "x" ]; then
78 echo "error: need to specify a release version"
79 exit 1
80fi
81
Hans Wennborgd61f7d82015-03-02 17:30:42 +000082# Make sure umask is not overly restrictive.
83umask 0022
84
Bill Wendlingee30e832013-06-07 11:15:30 +000085export_sources
86exit 0