| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 | #===-- tag.sh - Tag the LLVM release candidates ----------------------------===# | 
|  | 3 | # | 
| Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 4 | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | 
|  | 5 | # See https://llvm.org/LICENSE.txt for license information. | 
|  | 6 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | 
| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 7 | # | 
|  | 8 | #===------------------------------------------------------------------------===# | 
|  | 9 | # | 
|  | 10 | # Create branches and release candidates for the LLVM release. | 
|  | 11 | # | 
|  | 12 | #===------------------------------------------------------------------------===# | 
|  | 13 |  | 
|  | 14 | set -e | 
|  | 15 |  | 
| Hans Wennborg | cfb85e0 | 2015-07-17 16:49:59 +0000 | [diff] [blame] | 16 | projects="llvm cfe test-suite compiler-rt libcxx libcxxabi clang-tools-extra polly lldb lld openmp libunwind" | 
| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 17 | base_url="https://llvm.org/svn/llvm-project" | 
|  | 18 |  | 
|  | 19 | release="" | 
|  | 20 | rc="" | 
|  | 21 |  | 
| Dimitry Andric | ee72a1f | 2016-01-16 15:18:35 +0000 | [diff] [blame] | 22 | usage() { | 
| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 23 | echo "Export the SVN sources and build tarballs from them" | 
|  | 24 | echo "usage: `basename $0`" | 
|  | 25 | echo " " | 
|  | 26 | echo "  -release <num> The version number of the release" | 
|  | 27 | echo "  -rc <num>      The release candidate number" | 
|  | 28 | echo "  -final         The final tag" | 
|  | 29 | } | 
|  | 30 |  | 
| Dimitry Andric | ee72a1f | 2016-01-16 15:18:35 +0000 | [diff] [blame] | 31 | export_sources() { | 
| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 32 | release_no_dot=`echo $release | sed -e 's,\.,,g'` | 
|  | 33 | tag_dir="tags/RELEASE_$release_no_dot/$rc" | 
|  | 34 |  | 
|  | 35 | if [ "$rc" = "final" ]; then | 
|  | 36 | rc="" | 
|  | 37 | fi | 
|  | 38 |  | 
|  | 39 | for proj in $projects; do | 
|  | 40 | echo "Exporting $proj ..." | 
|  | 41 | svn export \ | 
|  | 42 | $base_url/$proj/$tag_dir \ | 
|  | 43 | $proj-$release$rc.src | 
|  | 44 |  | 
|  | 45 | echo "Creating tarball ..." | 
| Bill Wendling | 24c6f57 | 2014-08-26 08:11:22 +0000 | [diff] [blame] | 46 | tar cfJ $proj-$release$rc.src.tar.xz $proj-$release$rc.src | 
| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 47 | done | 
|  | 48 | } | 
|  | 49 |  | 
|  | 50 | while [ $# -gt 0 ]; do | 
|  | 51 | case $1 in | 
|  | 52 | -release | --release ) | 
|  | 53 | shift | 
|  | 54 | release=$1 | 
|  | 55 | ;; | 
|  | 56 | -rc | --rc ) | 
|  | 57 | shift | 
|  | 58 | rc="rc$1" | 
|  | 59 | ;; | 
|  | 60 | -final | --final ) | 
|  | 61 | rc="final" | 
|  | 62 | ;; | 
|  | 63 | -h | -help | --help ) | 
|  | 64 | usage | 
|  | 65 | exit 0 | 
|  | 66 | ;; | 
|  | 67 | * ) | 
|  | 68 | echo "unknown option: $1" | 
|  | 69 | usage | 
|  | 70 | exit 1 | 
|  | 71 | ;; | 
|  | 72 | esac | 
|  | 73 | shift | 
|  | 74 | done | 
|  | 75 |  | 
|  | 76 | if [ "x$release" = "x" ]; then | 
|  | 77 | echo "error: need to specify a release version" | 
|  | 78 | exit 1 | 
|  | 79 | fi | 
|  | 80 |  | 
| Hans Wennborg | d61f7d8 | 2015-03-02 17:30:42 +0000 | [diff] [blame] | 81 | # Make sure umask is not overly restrictive. | 
|  | 82 | umask 0022 | 
|  | 83 |  | 
| Bill Wendling | ee30e83 | 2013-06-07 11:15:30 +0000 | [diff] [blame] | 84 | export_sources | 
|  | 85 | exit 0 |