You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/01/28 15:10:21 UTC

[nuttx] branch master updated: tools/version: generate dummy version without breakout

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/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new d96189ce26 tools/version: generate dummy version without breakout
d96189ce26 is described below

commit d96189ce26eaf116f2426fe38e9cd1b5d6f70a22
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Dec 20 12:10:08 2022 +0800

    tools/version: generate dummy version without breakout
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 tools/version.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/version.sh b/tools/version.sh
index 4eb987aeba..53b26e95b4 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -76,7 +76,7 @@ if [ -z ${VERSION} ] ; then
   # 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} -c 'versionsort.suffix=-' 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 2>/dev/null | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-`
   fi
 
 fi
@@ -117,12 +117,11 @@ PATCH=`echo ${VERSION} | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" | cut -d'.' -f3`
 # Get GIT information (if not provided on the command line)
 
 if [ -z "${BUILD}" ]; then
-  BUILD=`git -C ${WD} log --oneline -1 | cut -d' ' -f1 2>/dev/null`
+  BUILD=`git -C ${WD} log --oneline -1 2>/dev/null | cut -d' ' -f1`
   if [ -z "${BUILD}" ]; then
     echo "GIT version information is not available"
-    exit 5
   fi
-  if [ -n "`git -C ${WD} diff-index --name-only HEAD | head -1`" ]; then
+  if [ -n "`git -C ${WD} diff-index --name-only HEAD 2>/dev/null | head -1`" ]; then
     BUILD=${BUILD}-dirty
   fi
 fi