From 1db9282058058088dfe51fca9be4e8b19c6ba99c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 4 May 2020 15:49:46 -0400 Subject: [PATCH] Fix buildrpm script --- confluent_osdeploy/buildrpm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/buildrpm b/confluent_osdeploy/buildrpm index 91b947ee..531b49ff 100644 --- a/confluent_osdeploy/buildrpm +++ b/confluent_osdeploy/buildrpm @@ -1,7 +1,11 @@ -export VERSION=$(git describe --tags) +VERSION=`git describe|cut -d- -f 1` +NUMCOMMITS=`git describe|cut -d- -f 2` +if [ "$NUMCOMMITS" != "$VERSION" ]; then + VERSION=$VERSION.dev$NUMCOMMITS.g`git describe|cut -d- -f 3` +fi sed -e "s/#VERSION#/$VERSION/" confluent_osdeploy.spec.tmpl > confluent_osdeploy.spec cd .. tar Jcvf confluent_osdeploy.tar.xz confluent_osdeploy -mv $confluent_osdeploy.tar.xz ~/rpmbuild/SOURCES/ +mv confluent_osdeploy.tar.xz ~/rpmbuild/SOURCES/ cd - rpmbuild -ba confluent_osdeploy.spec