From a455c92627657c8e11589a04ba7ebc1dcf248f1b Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Wed, 24 Jul 2013 14:52:12 +0200 Subject: build: add "+" version appendix automatically during build For each build that has no tag name (thus for all commits except releases), we add a "+" version appendix to indicate that it is further than the rc tag itself, like in the kernel. Do this during configure automatically. This is useful in case someone wants to package a relase, so that the full version name indicates that. Signed-off-by: Daniel Borkmann --- configure | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 5e24313..15b2705 100755 --- a/configure +++ b/configure @@ -505,6 +505,21 @@ EOF fi } +gen_version_appendix() +{ + local _appendix="" + + git rev-parse > /dev/null 2>&1 + if [ "$?" == "0" ] ; then + if [ ! "`git describe --always`" == \ + "`git describe --abbrev=0 --tags`" ] ; then + _appendix="+" + fi + fi + + echo "CONFIG_RC=\"$_appendix\"" >> Config +} + gen_config_hdr() { local _version="" @@ -583,6 +598,7 @@ check_libcli check_libnet gen_config_hdr +gen_version_appendix if [ "$MISSING_DEFS" == "1" ] ; then echo "[!] Some libraries or header definitions are missing or too old." -- cgit v1.2.3-54-g00ecf