From 9916c56721a4076bdba57c2aaf97b50b10d04e8f Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Mon, 11 Mar 2024 20:56:30 +1100 Subject: [PATCH] fix for version release --- git-retag.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/git-retag.sh b/git-retag.sh index 15e96de..b6dbf61 100755 --- a/git-retag.sh +++ b/git-retag.sh @@ -144,13 +144,17 @@ for tag in $OLDTAGS ; do -H "Authorization: token $GITEAACCESSTOKEN" ) done # Now create the version and release tag from the specfile -VERSION_RELEASE=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec` +VERSION_RELEASE_LONG=`rpm --queryformat '%{version} %{release}\n' --specfile $REPO_NAME.spec` +VERSION_RELEASE=${VERSION_RELEASE_LONG%%$'\n'*} VERSION=${VERSION_RELEASE% *} -REST=${VERSION_RELEASE#* } -RELEASE=${REST#* } -# Release is not reliable - if you run on Rocky it comes back EL8, centos 7 - EL7 -# So, we need to just take the build part (first word) +RELEASE=${VERSION_RELEASE#* } TAG=$VERSION"-"${RELEASE%.*} +if [ $DEBUG ] ; then + echo "VERSION_RELEASE=$VERSION_RELEASE" + echo "VERSION=$VERSION" + echo "RELEASE=$RELEASE" + echo "TAG=$TAG" +fi git pull git tag -a $TAG -m "Setting tag to current Version-Release in spec file: $TAG" git push origin --tag $TAG $QUIET