[LTP] [PATCH 2/5] tools: Add script for creating tarballs and metadata
Petr Vorel
pvorel@suse.cz
Wed Sep 20 11:53:15 CEST 2023
A helper for new releases.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
tools/create-tarballs-metadata.sh | 52 +++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100755 tools/create-tarballs-metadata.sh
diff --git a/tools/create-tarballs-metadata.sh b/tools/create-tarballs-metadata.sh
new file mode 100755
index 000000000..4736c9d36
--- /dev/null
+++ b/tools/create-tarballs-metadata.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# Copyright (c) 2023 Petr Vorel <pvorel@suse.cz>
+# Create tarballs and metadata for uploading after tagging release.
+# https://github.com/linux-test-project/ltp/wiki/LTP-Release-Procedure
+set -e
+
+tag="$(date +%Y%m%d)"
+tarball_dir="ltp-full-$tag"
+extensions="bz2 xz"
+checksums="md5 sha1 sha256"
+git_dir=$(cd $(dirname "$0")/..; pwd)
+dir="$(cd $git_dir/../; pwd)/ltp-release-$tag"
+
+. $(dirname "$0")/lib.sh
+
+if [ -d $dir ]; then
+ ask "Directory '$dir' exists, will be deleted"
+ rm -rf $dir
+fi
+rod mkdir $dir
+cd $dir
+dir=$PWD
+
+# git clone (local)
+title "git clone"
+rod git clone $git_dir $tarball_dir
+rod cd $tarball_dir
+rod git submodule update --init
+rod make autotools
+
+# tarballs, checksums
+title "Creating tarballs"
+cd ..
+rod tar --exclude .git -cjf $tarball_dir.tar.bz2 $tarball_dir
+rod tar --exclude .git -cJf $tarball_dir.tar.xz $tarball_dir
+
+title "Creating checksums"
+for alg in $checksums; do
+ for ext in $extensions; do
+ file="$tarball_dir.tar.$ext"
+ ${alg}sum $file > "$file.$alg"
+ done
+done
+
+# metadata documentation
+title "Creating metadata documentation"
+cd $tarball_dir
+rod ./configure --with-metadata-generator=asciidoctor
+rod make -C metadata
+cp -v docparse/metadata.html $dir/metadata.$tag.html
+
+echo "Generated files are in '$dir', upload them to github"
--
2.40.1
More information about the ltp
mailing list