From a12abc672b7f098e7b470da63b8dbf2f05974125 Mon Sep 17 00:00:00 2001 From: Dmitry Burmistrov Date: Wed, 19 Apr 2017 18:04:30 +0400 Subject: [PATCH] [build] Ignore non-numerical tags Skip non-numerical git tags (like `liberty-eol`) on version detect Related-Bug: #1682851 Change-Id: I949269c7b46d7c088f5919a8de28359547704ae1 --- perestroika/build-deb.sh | 2 +- perestroika/build-rpm.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/perestroika/build-deb.sh b/perestroika/build-deb.sh index 1447454..1d3ce9f 100755 --- a/perestroika/build-deb.sh +++ b/perestroika/build-deb.sh @@ -40,7 +40,7 @@ main () { TAR_NAME="${srcpackagename}_${pkg_version}.orig.tar.gz" if [ "$IS_OPENSTACK" == "true" ] ; then # Get version number from the latest git tag for openstack packages - local release_tag=$(git -C $_srcpath describe --abbrev=0 --candidates=1 | sed -r 's|^[^0-9]+||') + local release_tag=$(git -C $_srcpath describe --abbrev=0 --candidates=1 --match "*[0-9]*" | sed -r 's|^[^0-9]+||') # Deal with PyPi versions like 2015.1.0rc1 # It breaks version comparison # Change it to 2015.1.0~rc1 diff --git a/perestroika/build-rpm.sh b/perestroika/build-rpm.sh index d40c294..045aece 100755 --- a/perestroika/build-rpm.sh +++ b/perestroika/build-rpm.sh @@ -44,7 +44,7 @@ This package provides the %{-n*} kernel modules local gitspecsha=$(git -C ${_specpath} log -n 1 --pretty=format:%H) local gitspecprj=$(git -C ${_specpath} remote -v | head -n 1 | awk '{print $2}' | awk -F '/' '{print $NF}' | sed 's|.git$||' ) # Get version number from the latest git tag for openstack packages - local release_tag=$(git -C $_srcpath describe --abbrev=0 --candidates=1 | sed -r 's|^[^0-9]+||') + local release_tag=$(git -C $_srcpath describe --abbrev=0 --candidates=1 --match "*[0-9]*" | sed -r 's|^[^0-9]+||') # Deal with PyPi versions like 2015.1.0rc1 # It breaks version comparison # Change it to 2015.1.0~rc1