This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] create-version.sh: Generate a version from the git revision


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]