[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / utils / release / export.sh
blob0c76ed0470818e217725ae07dfcdee72efe09216
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 clang compiler-rt libcxx libcxxabi libclc clang-tools-extra polly lldb lld openmp libunwind flang"
18 release=""
19 rc=""
21 usage() {
22 echo "Export the Git sources and build tarballs from them"
23 echo "usage: `basename $0`"
24 echo " "
25 echo " -release <num> The version number of the release"
26 echo " -rc <num> The release candidate number"
27 echo " -final The final tag"
30 export_sources() {
31 release_no_dot=`echo $release | sed -e 's,\.,,g'`
32 tag="llvmorg-$release"
34 if [ "$rc" = "final" ]; then
35 rc=""
36 else
37 tag="$tag-$rc"
40 llvm_src_dir=$(readlink -f $(dirname "$(readlink -f "$0")")/../../..)
41 [ -d $llvm_src_dir/.git ] || ( echo "No git repository at $llvm_src_dir" ; exit 1 )
43 echo $tag
44 target_dir=$(pwd)
46 echo "Creating tarball for llvm-project ..."
47 pushd $llvm_src_dir/
48 git archive --prefix=llvm-project-$release$rc.src/ $tag . | xz >$target_dir/llvm-project-$release$rc.src.tar.xz
49 popd
51 if [ ! -d test-suite-$release$rc.src ]
52 then
53 echo "Fetching LLVM test-suite source ..."
54 mkdir -p test-suite-$release$rc.src
55 curl -L https://github.com/llvm/test-suite/archive/$tag.tar.gz | \
56 tar -C test-suite-$release$rc.src --strip-components=1 -xzf -
58 echo "Creating tarball for test-suite ..."
59 tar --sort=name --owner=0 --group=0 \
60 --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
61 -cJf test-suite-$release$rc.src.tar.xz test-suite-$release$rc.src
63 for proj in $projects; do
64 echo "Creating tarball for $proj ..."
65 pushd $llvm_src_dir/$proj
66 git archive --prefix=$proj-$release$rc.src/ $tag . | xz >$target_dir/$proj-$release$rc.src.tar.xz
67 popd
68 done
71 while [ $# -gt 0 ]; do
72 case $1 in
73 -release | --release )
74 shift
75 release=$1
77 -rc | --rc )
78 shift
79 rc="rc$1"
81 -final | --final )
82 rc="final"
84 -h | -help | --help )
85 usage
86 exit 0
88 * )
89 echo "unknown option: $1"
90 usage
91 exit 1
93 esac
94 shift
95 done
97 if [ "x$release" = "x" ]; then
98 echo "error: need to specify a release version"
99 exit 1
102 # Make sure umask is not overly restrictive.
103 umask 0022
105 export_sources
106 exit 0