[ARM] Fixup pipeline test. NFC
[llvm-complete.git] / utils / release / export.sh
blob9cd64a3d255fd2f197ba233e5172bee8bde13c3f
1 #!/bin/sh
2 #===-- tag.sh - Tag the LLVM release candidates ----------------------------===#
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
8 #===------------------------------------------------------------------------===#
10 # Create branches and release candidates for the LLVM release.
12 #===------------------------------------------------------------------------===#
14 set -e
16 projects="llvm cfe test-suite compiler-rt libcxx libcxxabi clang-tools-extra polly lldb lld openmp libunwind"
17 base_url="https://llvm.org/svn/llvm-project"
19 release=""
20 rc=""
22 usage() {
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"
31 export_sources() {
32 release_no_dot=`echo $release | sed -e 's,\.,,g'`
33 tag_dir="tags/RELEASE_$release_no_dot/$rc"
35 if [ "$rc" = "final" ]; then
36 rc=""
39 for proj in $projects; do
40 echo "Exporting $proj ..."
41 svn export \
42 $base_url/$proj/$tag_dir \
43 $proj-$release$rc.src
45 echo "Creating tarball ..."
46 tar cfJ $proj-$release$rc.src.tar.xz $proj-$release$rc.src
47 done
50 while [ $# -gt 0 ]; do
51 case $1 in
52 -release | --release )
53 shift
54 release=$1
56 -rc | --rc )
57 shift
58 rc="rc$1"
60 -final | --final )
61 rc="final"
63 -h | -help | --help )
64 usage
65 exit 0
67 * )
68 echo "unknown option: $1"
69 usage
70 exit 1
72 esac
73 shift
74 done
76 if [ "x$release" = "x" ]; then
77 echo "error: need to specify a release version"
78 exit 1
81 # Make sure umask is not overly restrictive.
82 umask 0022
84 export_sources
85 exit 0