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 #===------------------------------------------------------------------------===#
16 projects
="llvm clang compiler-rt libcxx libcxxabi libclc clang-tools-extra polly lldb lld openmp libunwind flang"
22 echo "Export the Git sources and build tarballs from them"
23 echo "usage: `basename $0`"
25 echo " -release <num> The version number of the release"
26 echo " -rc <num> The release candidate number"
27 echo " -final The final tag"
31 release_no_dot
=`echo $release | sed -e 's,\.,,g'`
32 tag
="llvmorg-$release"
34 if [ "$rc" = "final" ]; then
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 )
46 echo "Creating tarball for llvm-project ..."
48 git archive
--prefix=llvm-project-
$release$rc.src
/ $tag . | xz
>$target_dir/llvm-project-
$release$rc.src.
tar.xz
51 if [ ! -d test-suite-
$release$rc.src
]
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
71 while [ $# -gt 0 ]; do
73 -release |
--release )
89 echo "unknown option: $1"
97 if [ "x$release" = "x" ]; then
98 echo "error: need to specify a release version"
102 # Make sure umask is not overly restrictive.