This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] create-version.sh: Generate a version from the git revision
- From: Kieran Bingham <kieran at bingham dot xyz>
- To: gdb-patches at sourceware dot org
- Cc: vapier at gentoo dot org, Kieran Bingham <kieran dot bingham at linaro dot org>
- Date: Thu, 25 Feb 2016 14:54:43 +0000
- Subject: [PATCH] create-version.sh: Generate a version from the git revision
- Authentication-results: sourceware.org; auth=none
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 <kieran.bingham@linaro.org>
+ * common/create-version.sh (git): Provide git commit identifier
+ on -git branches
+
2016-02-25 Antoine Tremblay <antoine.tremblay@ericsson.com>
* 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
--
2.5.0