Browse Source

version reporting: use git branch and commit if available

pull/13/head
Richard Fuchs 12 years ago
parent
commit
681b2c1a24
5 changed files with 23 additions and 12 deletions
  1. +1
    -1
      daemon/.ycm_extra_conf.py
  2. +17
    -6
      daemon/Makefile
  3. +1
    -1
      daemon/call.c
  4. +1
    -1
      daemon/control_tcp.c
  5. +3
    -3
      daemon/main.c

+ 1
- 1
daemon/.ycm_extra_conf.py View File

@ -22,7 +22,7 @@ flags = [
'-I../kernel-module/',
'-D_GNU_SOURCE',
'-D__DEBUG=1',
'-DMEDIAPROXY_VERSION="dummy"',
'-DRTPENGINE_VERSION="dummy"',
'-DMP_PLUGIN_DIR="/usr/lib/rtpengine"',
'-O2',
'-fstack-protector',


+ 17
- 6
daemon/Makefile View File

@ -8,16 +8,27 @@ CFLAGS+= `pkg-config --cflags openssl`
CFLAGS+= `pcre-config --cflags`
CFLAGS+= -I../kernel-module/
CFLAGS+= -D_GNU_SOURCE
ifneq ($(MEDIAPROXY_VERSION),)
CFLAGS+= -DMEDIAPROXY_VERSION="\"$(MEDIAPROXY_VERSION)\""
else
ifeq ($(RTPENGINE_VERSION),)
DPKG_PRSCHNGLG= $(shell which dpkg-parsechangelog 2>/dev/null)
ifneq ($(DPKG_PRSCHNGLG),)
CFLAGS+= -DMEDIAPROXY_VERSION="\"$(shell dpkg-parsechangelog -l../debian/changelog | awk '/^Version: / {print $$2}')\""
else
CFLAGS+= -DMEDIAPROXY_VERSION="\"undefined\""
DPKG_PRSCHNGLG=$(shell dpkg-parsechangelog -l../debian/changelog | awk '/^Version: / {print $$2}')
endif
GIT_BR_COMMIT=$(shell git branch --no-color --no-column -v 2> /dev/null | awk -e '/^\*/ {OFS="-"; print "git", $$2, $$3}')
ifneq ($(DPKG_PRSCHNGLG),)
RTPENGINE_VERSION+=$(DPKG_PRSCHNGLG)
endif
ifneq ($(GIT_BR_COMMIT),)
RTPENGINE_VERSION+=$(GIT_BR_COMMIT)
endif
ifeq ($(RTPENGINE_VERSION),)
RTPENGINE_VERSION+=undefined
endif
endif
CFLAGS+= -DRTPENGINE_VERSION="\"$(RTPENGINE_VERSION)\""
CFLAGS+= -DMP_PLUGIN_DIR="\"/usr/lib/rtpengine\""
#CFLAGS+= -DSRTCP_KEY_DERIVATION_RFC_COMPLIANCE


+ 1
- 1
daemon/call.c View File

@ -986,7 +986,7 @@ retry:
xmlrpc_env_init(&e);
xmlrpc_client_setup_global_const(&e);
xmlrpc_client_create(&e, XMLRPC_CLIENT_NO_FLAGS, "ngcp-rtpengine", MEDIAPROXY_VERSION,
xmlrpc_client_create(&e, XMLRPC_CLIENT_NO_FLAGS, "ngcp-rtpengine", RTPENGINE_VERSION,
NULL, 0, &c);
if (e.fault_occurred)
goto fault;


+ 1
- 1
daemon/control_tcp.c View File

@ -123,7 +123,7 @@ static int control_stream_parse(struct control_stream *s, char *line) {
else if (!strcmp(out[RE_TCP_DIV_CMD], "status"))
calls_status_tcp(c->callmaster, s);
else if (!strcmp(out[RE_TCP_DIV_CMD], "build") | !strcmp(out[RE_TCP_DIV_CMD], "version"))
control_stream_printf(s, "Version: %s\n", MEDIAPROXY_VERSION);
control_stream_printf(s, "Version: %s\n", RTPENGINE_VERSION);
else if (!strcmp(out[RE_TCP_DIV_CMD], "controls"))
control_list(c, s);
else if (!strcmp(out[RE_TCP_DIV_CMD], "quit") || !strcmp(out[RE_TCP_DIV_CMD], "exit"))


+ 3
- 3
daemon/main.c View File

@ -274,7 +274,7 @@ static void options(int *argc, char ***argv) {
die("Bad command line: %s\n", er->message);
if (version)
die("%s\n", MEDIAPROXY_VERSION);
die("%s\n", RTPENGINE_VERSION);
if (!ipv4s)
die("Missing option --ip\n");
@ -549,7 +549,7 @@ int main(int argc, char **argv) {
options(&argc, &argv);
create_everything(&ctx);
ilog(LOG_INFO, "Startup complete, version %s", MEDIAPROXY_VERSION);
ilog(LOG_INFO, "Startup complete, version %s", RTPENGINE_VERSION);
thread_create_detach(sighandler, NULL);
thread_create_detach(timer_loop, ctx.p);
@ -565,7 +565,7 @@ int main(int argc, char **argv) {
threads_join_all(1);
ilog(LOG_INFO, "Version %s shutting down", MEDIAPROXY_VERSION);
ilog(LOG_INFO, "Version %s shutting down", RTPENGINE_VERSION);
return 0;
}

Loading…
Cancel
Save