mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
tools/version.sh: Fix version number to get on master branch
Fix an issue that the nuttx version is not '10.1.0' but '10.1.0-RC1' on the master branch. Add a pattern match of "nuttx-" to tags obtained from git describe.
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
ad2f859170
commit
383b2b7af2
+2
-2
@@ -71,12 +71,12 @@ done
|
|||||||
OUTFILE=$1
|
OUTFILE=$1
|
||||||
|
|
||||||
if [ -z ${VERSION} ] ; then
|
if [ -z ${VERSION} ] ; then
|
||||||
VERSION=`git -C ${WD} describe 2>/dev/null | tail -1 | cut -d'-' -f2`
|
VERSION=`git -C ${WD} describe --match "nuttx-*" 2>/dev/null | tail -1 | cut -d'-' -f2`
|
||||||
|
|
||||||
# If the VERSION does not match X.Y.Z, retrieve version from the tag
|
# If the VERSION does not match X.Y.Z, retrieve version from the tag
|
||||||
|
|
||||||
if [[ ! ${VERSION} =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]] ; then
|
if [[ ! ${VERSION} =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]] ; then
|
||||||
VERSION=`git -C ${WD} tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
|
VERSION=`git -C ${WD} -c 'versionsort.suffix=-' tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user