From commits-return-25625-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Thu Dec 17 18:14:51 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id F3BD0180608 for ; Thu, 17 Dec 2020 19:14:50 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 72DB367183 for ; Thu, 17 Dec 2020 18:14:50 +0000 (UTC) Received: (qmail 42003 invoked by uid 500); 17 Dec 2020 18:14:49 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 41994 invoked by uid 99); 17 Dec 2020 18:14:49 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Dec 2020 18:14:49 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 69B7F81786; Thu, 17 Dec 2020 18:14:49 +0000 (UTC) Date: Thu, 17 Dec 2020 18:14:49 +0000 To: "commits@nuttx.apache.org" Subject: [incubator-nuttx] branch master updated: tools/version.sh: Fix the version retrieved from GIT. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <160822888923.30012.8435254715153082354@gitbox.apache.org> From: btashton@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-nuttx X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 48ba0bb30a5f141f944f6570eff404b1ee0694f1 X-Git-Newrev: 076d89907f78995aeb68b4b3c5e702f76335aa04 X-Git-Rev: 076d89907f78995aeb68b4b3c5e702f76335aa04 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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 --- 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