2013-06-07 13:15:30 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#===-- tag.sh - Tag the LLVM release candidates ----------------------------===#
|
|
|
|
#
|
2019-01-19 09:50:56 +01:00
|
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2013-06-07 13:15:30 +02:00
|
|
|
#
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
#
|
|
|
|
# Create branches and release candidates for the LLVM release.
|
|
|
|
#
|
|
|
|
#===------------------------------------------------------------------------===#
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-11-22 20:51:00 +01:00
|
|
|
projects="llvm clang compiler-rt libcxx libcxxabi libclc clang-tools-extra polly lldb lld openmp libunwind flang"
|
2013-06-07 13:15:30 +02:00
|
|
|
|
|
|
|
release=""
|
|
|
|
rc=""
|
|
|
|
|
2016-01-16 16:18:35 +01:00
|
|
|
usage() {
|
2019-11-27 20:44:20 +01:00
|
|
|
echo "Export the Git sources and build tarballs from them"
|
2013-06-07 13:15:30 +02:00
|
|
|
echo "usage: `basename $0`"
|
|
|
|
echo " "
|
|
|
|
echo " -release <num> The version number of the release"
|
|
|
|
echo " -rc <num> The release candidate number"
|
|
|
|
echo " -final The final tag"
|
|
|
|
}
|
|
|
|
|
2016-01-16 16:18:35 +01:00
|
|
|
export_sources() {
|
2013-06-07 13:15:30 +02:00
|
|
|
release_no_dot=`echo $release | sed -e 's,\.,,g'`
|
2019-11-27 20:44:20 +01:00
|
|
|
tag="llvmorg-$release"
|
2013-06-07 13:15:30 +02:00
|
|
|
|
|
|
|
if [ "$rc" = "final" ]; then
|
|
|
|
rc=""
|
2019-11-27 20:44:20 +01:00
|
|
|
else
|
|
|
|
tag="$tag-$rc"
|
2013-06-07 13:15:30 +02:00
|
|
|
fi
|
|
|
|
|
2020-11-22 20:51:00 +01:00
|
|
|
llvm_src_dir=$(readlink -f $(dirname "$(readlink -f "$0")")/../../..)
|
|
|
|
[ -d $llvm_src_dir/.git ] || ( echo "No git repository at $llvm_src_dir" ; exit 1 )
|
2019-11-27 20:44:20 +01:00
|
|
|
|
|
|
|
echo $tag
|
2020-11-22 20:51:00 +01:00
|
|
|
target_dir=$(pwd)
|
2019-11-27 20:44:20 +01:00
|
|
|
|
|
|
|
echo "Creating tarball for llvm-project ..."
|
2020-11-22 20:51:00 +01:00
|
|
|
pushd $llvm_src_dir/
|
|
|
|
git archive --prefix=llvm-project-$release$rc.src/ $tag . | xz >$target_dir/llvm-project-$release$rc.src.tar.xz
|
|
|
|
popd
|
2013-06-07 13:15:30 +02:00
|
|
|
|
2020-11-22 20:51:00 +01:00
|
|
|
if [ ! -d test-suite-$release$rc.src ]
|
|
|
|
then
|
|
|
|
echo "Fetching LLVM test-suite source ..."
|
|
|
|
mkdir -p test-suite-$release$rc.src
|
|
|
|
curl -L https://github.com/llvm/test-suite/archive/$tag.tar.gz | \
|
|
|
|
tar -C test-suite-$release$rc.src --strip-components=1 -xzf -
|
|
|
|
fi
|
|
|
|
echo "Creating tarball for test-suite ..."
|
|
|
|
tar --sort=name --owner=0 --group=0 \
|
|
|
|
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime \
|
|
|
|
-cJf test-suite-$release$rc.src.tar.xz test-suite-$release$rc.src
|
2019-11-27 20:44:20 +01:00
|
|
|
|
|
|
|
for proj in $projects; do
|
|
|
|
echo "Creating tarball for $proj ..."
|
2020-11-22 20:51:00 +01:00
|
|
|
pushd $llvm_src_dir/$proj
|
|
|
|
git archive --prefix=$proj-$release$rc.src/ $tag . | xz >$target_dir/$proj-$release$rc.src.tar.xz
|
|
|
|
popd
|
2013-06-07 13:15:30 +02:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case $1 in
|
|
|
|
-release | --release )
|
|
|
|
shift
|
|
|
|
release=$1
|
|
|
|
;;
|
|
|
|
-rc | --rc )
|
|
|
|
shift
|
|
|
|
rc="rc$1"
|
|
|
|
;;
|
|
|
|
-final | --final )
|
|
|
|
rc="final"
|
|
|
|
;;
|
|
|
|
-h | -help | --help )
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
echo "unknown option: $1"
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "x$release" = "x" ]; then
|
|
|
|
echo "error: need to specify a release version"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-03-02 18:30:42 +01:00
|
|
|
# Make sure umask is not overly restrictive.
|
|
|
|
umask 0022
|
|
|
|
|
2013-06-07 13:15:30 +02:00
|
|
|
export_sources
|
|
|
|
exit 0
|