From patchwork Thu Feb 25 14:54:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11081 Received: (qmail 79803 invoked by alias); 25 Feb 2016 14:55:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 79784 invoked by uid 89); 25 Feb 2016 14:55:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:D*xyz, H*MI:21530, H*m:21530, DATE X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 25 Feb 2016 14:55:01 +0000 Received: by mail-wm0-f41.google.com with SMTP id g62so31251752wme.0 for ; Thu, 25 Feb 2016 06:55:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=hODdiCmXHGPB7MIBr1uyLlBvKZHzzEmKbLK8NCTLdoE=; b=j9iu9nEZve2qxOPVWlmVkEySMN9XYKSvcIig5KqQV1Cvy7ah6fe0QFHk1bVndx5KZF 2iJpcGAelGCT4a+mHdVMyAnqgTjLF/jaQy15WOL96sHkRWqxM9beheE/nq+mA1zPISpO KK8XdydbN3Mh4yIH41PUbwPO9SjWwEe45DPRATe+AdpcQgjYKz7sTytzSTkDrwO8VG/5 +13sWFHAjN+JTQlX7lrZoBotYHaVuIIwCkRPneWx1Ov1HnM5TE1xkN0qDRPSlus227ES KR7/DoQixysGWXX70lD2UNWbmGlqM0g/FdAdgQ2X5cvsfQmuODl4yFD9m+SS5SvMF+lQ v3kg== X-Gm-Message-State: AG10YOSiiKVqyh6xyGatJVHEtmjrpL7TCZOCF90HydhFIwWL0QMyT7QoN4Tt7a47FJJJEw== X-Received: by 10.28.137.148 with SMTP id l142mr4049463wmd.40.1456412098942; Thu, 25 Feb 2016 06:54:58 -0800 (PST) Received: from localhost.localdomain (cpc87017-aztw30-2-0-cust65.18-1.cable.virginm.net. [92.232.232.66]) by smtp.gmail.com with ESMTPSA id jo6sm8308573wjb.48.2016.02.25.06.54.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 06:54:57 -0800 (PST) From: Kieran Bingham X-Google-Original-From: Kieran Bingham To: gdb-patches@sourceware.org Cc: vapier@gentoo.org, Kieran Bingham Subject: [PATCH] create-version.sh: Generate a version from the git revision Date: Thu, 25 Feb 2016 14:54:43 +0000 Message-Id: <1456412083-21530-1-git-send-email-kieran.bingham@linaro.org> X-IsSubscribed: yes If git is available and able to identify a revision string, it will be appended to the -scm tag at the end of the version string Should git not be available, the string will not be adjusted gdb/Changelog: * common/create-version.sh (git): Provide git commit identifier on -git branches --- gdb/ChangeLog | 4 ++++ gdb/common/create-version.sh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dc123996c544..d7182a1996b8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-02-25 Kieran Bingham + * common/create-version.sh (git): Provide git commit identifier + on -git branches + 2016-02-25 Antoine Tremblay * ax-general.c (ax_reg): Call gdbarch_remote_register_number. diff --git a/gdb/common/create-version.sh b/gdb/common/create-version.sh index e0f9eb341d3f..69815283363a 100755 --- a/gdb/common/create-version.sh +++ b/gdb/common/create-version.sh @@ -30,6 +30,10 @@ output="$4" rm -f version.c-tmp $output version.tmp date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h` sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp +gitver=`git -C $srcdir describe --always --dirty` +if [ -n "$gitver" ]; then + sed -i -e "s/-git/-git-$gitver/" version.tmp +fi echo '#include "version.h"' >> version.c-tmp echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp