This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 383b2b7  tools/version.sh: Fix version number to get on master branch
383b2b7 is described below

commit 383b2b7af294e6208def52ae8e6b00f8eaff0f2f
Author: baggio63446333 <baggio63446...@users.noreply.github.com>
AuthorDate: Tue Jul 13 12:25:19 2021 +0900

    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.
---
 tools/version.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/version.sh b/tools/version.sh
index f0e5efb..4eb987a 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -71,12 +71,12 @@ done
 OUTFILE=$1
 
 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 [[ ! ${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

Reply via email to