nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btash...@apache.org
Subject [incubator-nuttx] branch master updated: tools/version.sh: Fix the version retrieved from GIT.
Date Thu, 17 Dec 2020 18:14:49 GMT
This is an automated email from the ASF dual-hosted git repository.

btashton 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 076d899  tools/version.sh: Fix the version retrieved from GIT.
076d899 is described below

commit 076d89907f78995aeb68b4b3c5e702f76335aa04
Author: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
AuthorDate: Thu Dec 17 09:57:35 2020 +0000

    tools/version.sh: Fix the version retrieved from GIT.
    
    Use the branch's tag if one exist otherwise use the most recent one.
    
    Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
---
 tools/version.sh | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/version.sh b/tools/version.sh
index fd815da..813c97a 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -86,12 +86,10 @@ done
 OUTFILE=$1
 
 if [ -z ${VERSION} ] ; then
-  VERSION=`git -C ${WD} tag --sort=taggerdate | tail -1 | cut -d'-' -f2`
+  VERSION=`git -C ${WD} describe 2>/dev/null | tail -1 | cut -d'-' -f2`
 
-  # Earlier tags used the format "major.minor", append a "0" for a patch.
-
-  if [[ ${VERSION} =~ ^([0-9]+[\.][0-9]+)$ ]] ; then
-    VERSION=${VERSION}.0
+  if [[ ! ${VERSION} =~ ([0-9]+).([0-9]+).([0-9]+) ]] ; then
+    VERSION=`git -C ${WD} tag --sort=v:refname | tail -1 | cut -d'-' -f2`
   fi
 fi
 


Mime
View raw message