From ee8ff948bfc1a21a10ea7e5bb34fffde781624e6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 17 Sep 2013 01:28:35 +0100 Subject: Use git revision in development strings --- src/xmpp/capabilities.c | 11 +++++++++++ src/xmpp/iq.c | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'src/xmpp') diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index f38a2749..658be124 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -22,6 +22,10 @@ #include "config.h" +#ifdef HAVE_GIT_VERSION +#include "gitversion.c" +#endif + #include #include @@ -238,7 +242,14 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx) GString *name_str = g_string_new("Profanity "); g_string_append(name_str, PACKAGE_VERSION); if (strcmp(PACKAGE_STATUS, "development") == 0) { +#ifdef HAVE_GIT_VERSION + g_string_append(name_str, "dev."); + g_string_append(name_str, PROF_GIT_BRANCH); + g_string_append(name_str, "."); + g_string_append(name_str, PROF_GIT_REVISION); +#else g_string_append(name_str, "dev"); +#endif } xmpp_stanza_set_attribute(identity, "name", name_str->str); diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 8eb4d99e..1ddfcb34 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -22,6 +22,10 @@ #include "config.h" +#ifdef HAVE_GIT_VERSION +#include "gitversion.c" +#endif + #include #include @@ -236,7 +240,14 @@ _iq_handle_version_get(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, xmpp_stanza_t *version_txt = xmpp_stanza_new(ctx); GString *version_str = g_string_new(PACKAGE_VERSION); if (strcmp(PACKAGE_STATUS, "development") == 0) { +#ifdef HAVE_GIT_VERSION + g_string_append(version_str, "dev."); + g_string_append(version_str, PROF_GIT_BRANCH); + g_string_append(version_str, "."); + g_string_append(version_str, PROF_GIT_REVISION); +#else g_string_append(version_str, "dev"); +#endif } xmpp_stanza_set_text(version_txt, version_str->str); xmpp_stanza_add_child(version, version_txt); -- cgit 1.4.1-2-gfad0