[build] Ignore non-numerical tags

Skip non-numerical git tags (like `liberty-eol`) on version detect

   Related-Bug: #1682851

Change-Id: I949269c7b46d7c088f5919a8de28359547704ae1
This commit is contained in:
Dmitry Burmistrov 2017-04-19 18:04:30 +04:00
parent 6899ba3c59
commit a12abc672b
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ main () {
TAR_NAME="${srcpackagename}_${pkg_version}.orig.tar.gz" TAR_NAME="${srcpackagename}_${pkg_version}.orig.tar.gz"
if [ "$IS_OPENSTACK" == "true" ] ; then if [ "$IS_OPENSTACK" == "true" ] ; then
# Get version number from the latest git tag for openstack packages # 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 # Deal with PyPi versions like 2015.1.0rc1
# It breaks version comparison # It breaks version comparison
# Change it to 2015.1.0~rc1 # Change it to 2015.1.0~rc1

View File

@ -44,7 +44,7 @@ This package provides the %{-n*} kernel modules
local gitspecsha=$(git -C ${_specpath} log -n 1 --pretty=format:%H) 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$||' ) 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 # 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 # Deal with PyPi versions like 2015.1.0rc1
# It breaks version comparison # It breaks version comparison
# Change it to 2015.1.0~rc1 # Change it to 2015.1.0~rc1