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 dragonegg test-suite compiler-rt libcxx libcxxabi clang-tools-extra polly lldb lld openmp"
23 base_url="https://llvm.org/svn/llvm-project"
26 echo "usage: `basename $0` -release <num> [-rebranch] [-dry-run]"
27 echo "usage: `basename $0` -release <num> -rc <num> [-dry-run]"
29 echo " -release <num> The version number of the release"
30 echo " -rc <num> The release candidate number"
31 echo " -rebranch Remove existing branch, if present, before branching"
32 echo " -final Tag final release candidate"
33 echo " -dry-run Make no changes to the repository, just print the commands"
36 function tag_version() {
38 for proj in $projects; do
39 if svn ls $base_url/$proj/branches/release_$branch_release > /dev/null 2>&1 ; then
40 if [ $rebranch = "no" ]; then
43 ${dryrun} svn remove -m "Removing old release_$branch_release branch for rebranching." \
44 $base_url/$proj/branches/release_$branch_release
46 ${dryrun} svn copy -m "Creating release_$branch_release branch" \
47 $base_url/$proj/trunk \
48 $base_url/$proj/branches/release_$branch_release
53 function tag_release_candidate() {
55 for proj in $projects ; do
56 if ! svn ls $base_url/$proj/tags/RELEASE_$tag_release > /dev/null 2>&1 ; then
57 ${dryrun} svn mkdir -m "Creating release directory for release_$tag_release." $base_url/$proj/tags/RELEASE_$tag_release
59 if ! svn ls $base_url/$proj/tags/RELEASE_$tag_release/$rc > /dev/null 2>&1 ; then
60 ${dryrun} svn copy -m "Creating release candidate $rc from release_$tag_release branch" \
61 $base_url/$proj/branches/release_$branch_release \
62 $base_url/$proj/tags/RELEASE_$tag_release/$rc
68 while [ $# -gt 0 ]; do
70 -release | --release )
78 -rebranch | --rebranch )
84 -dry-run | --dry-run )
92 echo "unknown option: $1"
100 if [ "x$release" = "x" ]; then
101 echo "error: need to specify a release version"
107 branch_release=`echo $release | sed -e 's,\([0-9]*\.[0-9]*\).*,\1,' | sed -e 's,\.,,g'`
108 tag_release=`echo $release | sed -e 's,\.,,g'`
110 if [ "x$rc" = "x" ]; then
113 tag_release_candidate