2 #===-- tag.sh - Tag the LLVM release candidates ----------------------------===#
4 # The LLVM Compiler Infrastructure
6 # This file is distributed under the University of Illinois Open Source
9 #===------------------------------------------------------------------------===#
11 # Create branches and release candidates for the LLVM release.
13 #===------------------------------------------------------------------------===#
20 projects
="llvm cfe test-suite compiler-rt libcxx libcxxabi clang-tools-extra polly lldb lld openmp libunwind debuginfo-tests"
24 base_url
="https://llvm.org/svn/llvm-project"
27 echo "usage: `basename $0` -release <num> [-rebranch] [-revision <num>] [-dry-run]"
28 echo "usage: `basename $0` -release <num> -rc <num> [-dry-run]"
30 echo " -release <num> The version number of the release"
31 echo " -rc <num> The release candidate number"
32 echo " -rebranch Remove existing branch, if present, before branching"
33 echo " -final Tag final release candidate"
34 echo " -revision <num> Revision to branch off (default: HEAD)"
35 echo " -dry-run Make no changes to the repository, just print the commands"
40 for proj
in $projects; do
41 if svn
ls $base_url/$proj/branches
/release_
$branch_release > /dev
/null
2>&1 ; then
42 if [ $rebranch = "no" ]; then
45 ${dryrun} svn remove
-m "Removing old release_$branch_release branch for rebranching." \
46 $base_url/$proj/branches
/release_
$branch_release
48 ${dryrun} svn copy
-m "Creating release_$branch_release branch off revision ${revision}" \
50 $base_url/$proj/trunk \
51 $base_url/$proj/branches
/release_
$branch_release
56 tag_release_candidate
() {
58 for proj
in $projects ; do
59 if ! svn
ls $base_url/$proj/tags
/RELEASE_
$tag_release > /dev
/null
2>&1 ; then
60 ${dryrun} svn mkdir
-m "Creating release directory for release_$tag_release." $base_url/$proj/tags
/RELEASE_
$tag_release
62 if ! svn
ls $base_url/$proj/tags
/RELEASE_
$tag_release/$rc > /dev
/null
2>&1 ; then
63 ${dryrun} svn copy
-m "Creating release candidate $rc from release_$tag_release branch" \
64 $base_url/$proj/branches
/release_
$branch_release \
65 $base_url/$proj/tags
/RELEASE_
$tag_release/$rc
71 while [ $# -gt 0 ]; do
73 -release |
--release )
81 -rebranch |
--rebranch )
87 -revision |
--revision )
91 -dry-run |
--dry-run )
99 echo "unknown option: $1"
107 if [ "x$release" = "x" ]; then
108 echo "error: need to specify a release version"
114 branch_release
=`echo $release | sed -e 's,\([0-9]*\.[0-9]*\).*,\1,' | sed -e 's,\.,,g'`
115 tag_release
=`echo $release | sed -e 's,\.,,g'`
117 if [ "x$rc" = "x" ]; then
120 if [ "$revision" != "HEAD" ]; then
121 echo "error: cannot use -revision with -rc"
127 tag_release_candidate