From 8779cf37f8b3206913e7994aad5553c61510c340 Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Wed, 9 Nov 2022 00:09:27 +0800 Subject: [PATCH] fix: format version for rpm spec (#15330) Co-authored-by: QIU Jian --- build/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index e8f72eec3a..17b232c6e8 100755 --- a/build/build.sh +++ b/build/build.sh @@ -44,7 +44,12 @@ echo "Build root ${BUILDROOT}" if [ -z "$VERSION" ]; then TAG=$(git describe --abbrev=0 --tags || echo testing) VERSION=${TAG/\//-} - VERSION=${VERSION/v/} + if [[ "$VERSION" =~ ^v0. ]]; then + VERSION=${VERSION/v0./} + elif [[ "$VERSION" =~ ^v ]]; then + VERSION=${VERSION/v/} + fi + VERSION=${VERSION//-/.} fi RELEASE=`date +"%y%m%d%H"`