llvm.org GIT mirror llvm / 9a6d615
Add a helper script to create branches and tag release candidates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142098 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
1 changed file(s) with 95 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 #!/bin/sh
1 #===-- tag.sh - Tag the LLVM release candidates ----------------------------===#
2 #
3 # The LLVM Compiler Infrastructure
4 #
5 # This file is distributed under the University of Illinois Open Source
6 # License.
7 #
8 #===------------------------------------------------------------------------===#
9 #
10 # Create branches and release candidates for the LLVM release.
11 #
12 #===------------------------------------------------------------------------===#
13
14 set -e
15
16 release=""
17 rc=""
18
19 base_url="https://llvm.org/svn/llvm-project"
20
21 function usage() {
22 echo "usage: `basename $0` -release "
23 echo "usage: `basename $0` -release -rc "
24 echo " "
25 echo " -release The version number of the release"
26 echo " -rc The release candidate number"
27 }
28
29 function tag_version() {
30 set -x
31 for proj in llvm cfe dragonegg test-suite compiler-rt libcxx libcxxabi ; do
32 if ! svn ls $base_url/$proj/branches/release_$release > /dev/null 2>&1 ; then
33 svn copy -m "Creating release_$release branch" \
34 $base_url/$proj/trunk \
35 $base_url/$proj/branches/release_$release
36 fi
37 done
38 set +x
39 }
40
41 function tag_release_candidate() {
42 set -x
43 for proj in llvm cfe dragonegg test-suite compiler-rt libcxx libcxxabi ; do
44 if ! svn ls $base_url/$proj/tags/RELEASE_$release > /dev/null 2>&1 ; then
45 svn mkdir $base_url/$proj/tags/RELEASE_$release
46 fi
47 if ! svn ls $base_url/$proj/tags/RELEASE_$release/rc$rc > /dev/null 2>&1 ; then
48 svn copy -m "Creating release candidate $rc from release_$release branch" \
49 $base_url/$proj/branches/release_$release \
50 $base_url/$proj/tags/RELEASE_$release/rc$rc
51 fi
52 done
53 set +x
54 }
55
56 while [ $# -gt 0 ]; do
57 case $1 in
58 -release | --release )
59 shift
60 release=$1
61 ;;
62 -rc | --rc )
63 shift
64 rc=$1
65 ;;
66 -h | --help | -help )
67 usage
68 exit 0
69 ;;
70 * )
71 echo "unknown option: $1"
72 usage
73 exit 1
74 ;;
75 esac
76 shift
77 done
78
79 if [ "x$release" = "x" ]; then
80 echo "error: need to specify a release version"
81 echo
82 usage
83 exit 1
84 fi
85
86 release=`echo $release | sed -e 's,\.,,g'`
87
88 if [ "x$rc" = "x" ]; then
89 tag_version
90 else
91 tag_release_candidate
92 fi
93
94 exit 1