From f4847eec70966e766584345ee136d760be483815 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 11 May 2010 10:49:47 +0200 Subject: [PATCH] Log Git SHA-1 for info (-V) and daemon start --- configure.ac | 7 +++++++ src/metaproxy_prog.cpp | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c2945f7..b8c60e9 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,13 @@ fi AC_CHECK_HEADERS([sys/select.h sys/socket.h]) +if test -d ${srcdir}/.git; then + SHA1=`git show --pretty=format:%H|head -1` +else + SHA1=`head -1 ${srcdir}/ChangeLog|awk '{print $2}'` +fi +AC_DEFINE_UNQUOTED([VERSION_SHA1], "$SHA1", [SHA-1 from Git]) + AC_CONFIG_FILES([ Doxyfile Makefile diff --git a/src/metaproxy_prog.cpp b/src/metaproxy_prog.cpp index c1f6123..5eb24f8 100644 --- a/src/metaproxy_prog.cpp +++ b/src/metaproxy_prog.cpp @@ -124,7 +124,11 @@ static int sc_main( uid = arg; break; case 'V': - std::cout << VERSION "\n"; + std::cout << VERSION; +#ifdef VERSION_SHA1 + std::cout << " " VERSION_SHA1; +#endif + std::cout << "\n"; return 0; break; case 'w': @@ -153,7 +157,12 @@ static int sc_main( return 1; } - yaz_log(YLOG_LOG, "Metaproxy " VERSION " started"); + yaz_log(YLOG_LOG, "Metaproxy start " VERSION +#ifdef VERSION_SHA1 + " " VERSION_SHA1 +#endif + ); + xmlDocPtr doc = xmlReadFile(fname, NULL, XML_PARSE_XINCLUDE + XML_PARSE_NOBLANKS -- 1.7.10.4