The following commit has been merged in the master branch: commit a091f9dd7ffecefafc41eca062db45ecc1a5a5a7 Author: Sven Eckelmann sven@narfation.org Date: Tue Jul 5 10:54:59 2011 +0200
vis: Replace version info instead of appending them
The version number of vis can get revision numbers added. This is useful to give hints about the revision of a distribution package and the used patchset or the commit which was used to build it. The prepended source number or branch name doesn't add any additional information which would help to identify problems and can therefore be omitted.
Signed-off-by: Sven Eckelmann sven@narfation.org
diff --git a/Makefile b/Makefile index 745b6e3..1804155 100755 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ OBJ = allocate.o hash.o list-batman.o vis.o udp_server.o
# vis flags and options CFLAGS += -pedantic -Wall -W -std=gnu99 -MD -CPPFLAGS += -DDEBUG_MALLOC -DMEMORY_USAGE -DREVISION_VERSION=$(REVISION_VERSION) +CPPFLAGS += -DDEBUG_MALLOC -DMEMORY_USAGE LDLIBS += -lpthread
# disable verbose output @@ -50,8 +50,12 @@ PREFIX = /usr/local SBINDIR = $(PREFIX)/sbin
# try to generate revision -REVISION = $(shell if [ -d .git ]; then echo $$(git describe --always --dirty 2> /dev/null || echo "[unknown]"); fi) -REVISION_VERSION="\ $(REVISION)" +REVISION= $(shell if [ -d .git ]; then \ + echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \ + fi) +ifneq ($(REVISION),) +CPPFLAGS += -DSOURCE_VERSION="$(REVISION)" +endif
# default target all: $(BINARY_NAME) diff --git a/vis.c b/vis.c index a17e192..181d76a 100644 --- a/vis.c +++ b/vis.c @@ -901,7 +901,7 @@ int main( int argc, char **argv ) { }
- debug_output("B.A.T.M.A.N. visualisation server %s%s successfully started ... \n", SOURCE_VERSION, (strlen("REVISION_VERSION") > 3 ? REVISION_VERSION : "")); + debug_output("B.A.T.M.A.N. visualisation server %s successfully started ... \n", SOURCE_VERSION);
pthread_create( &udp_server_thread, NULL, &udp_server, NULL ); diff --git a/vis.h b/vis.h index 9f26ee6..74a3bd8 100644 --- a/vis.h +++ b/vis.h @@ -38,8 +38,9 @@ #include "allocate.h" #include "list-batman.h"
-#define SOURCE_VERSION "0.4-alpha" //put exactly one distinct word inside the string like "0.3-pre-alpha" or "0.3-rc1" or "0.3" - +#ifndef SOURCE_VERSION +#define SOURCE_VERSION "0.4" +#endif
#define MAXCHAR 4096
@@ -49,10 +50,6 @@
#define ADDR_STR_LEN 16
-#ifndef REVISION_VERSION -#define REVISION_VERSION "0" -#endif -