From 85edf0f49dfbb1ab85a4177e21b49b9d3e95b8b2 Mon Sep 17 00:00:00 2001 From: Matheus Castello Date: Wed, 17 Mar 2021 03:35:48 -0300 Subject: [PATCH] tools/version.sh: Add the remaining cut to VERSION The idea is to have something like EXTRAVERSION. This is useful for getting RC tags, development tags and for customizing the version. For example using the tag `nuttx-10.0.0-RC0` the VERSION will be `10.0.0-RC0` Signed-off-by: Matheus Castello --- include/sys/utsname.h | 2 +- tools/version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sys/utsname.h b/include/sys/utsname.h index abe7bd7d667..b152dc3ea7e 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -46,7 +46,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define SYS_NAMELEN 16 +#define SYS_NAMELEN 21 #define VERSION_NAMELEN 41 /**************************************************************************** diff --git a/tools/version.sh b/tools/version.sh index 8c47bd85c42..b255edc5d13 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} tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2` + VERSION=`git -C ${WD} tag --sort=v:refname | grep -E "nuttx-[0-9]+\.[0-9]+\.[0-9]+" | tail -1 | cut -d'-' -f2-` fi fi