]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Add dovecot_build_info variable containing Dovecot build information.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 18 May 2017 09:32:12 +0000 (12:32 +0300)
committerGitLab <gitlab@git.dovecot.net>
Fri, 19 May 2017 06:41:14 +0000 (09:41 +0300)
By default this includes the version, including the git hash. The idea is
that this version information would be available in all the core dumps.

The DOVECOT_BUILD_INFO can be overridden by compiling with:

DOVECOT_BUILD_INFO='"build info"' make

src/lib/lib.c
update-version.sh

index 04e577c54f7fc7e173ef48c9e4213940536514c1..4c20163d3686fa9074bafc956a54df3ec8893159 100644 (file)
@@ -1,6 +1,7 @@
 /* Copyright (c) 2001-2017 Dovecot authors, see the included COPYING file */
 
 #include "lib.h"
+#include "dovecot-version.h"
 #include "array.h"
 #include "env-util.h"
 #include "hostpid.h"
 #include <unistd.h>
 #include <sys/time.h>
 
+/* Mainly for including the full version information in core dumps.
+   NOTE: Don't set this const - otherwise it won't end up in core dumps. */
+char dovecot_build_info[] = DOVECOT_BUILD_INFO;
+
 static bool lib_initialized = FALSE;
 int dev_null_fd = -1;
 
index e610f2192b13f521b8cc9dcb7316fcae149c3dc9..0d2a388dc40352d855a706fff4cc869c03019adc 100644 (file)
@@ -4,6 +4,7 @@ SRCDIR="${1:-`pwd`}"
 BUILDDIR="${2:-`pwd`}"
 VERSION_H="dovecot-version.h"
 VERSION_HT="dovecot-version.h.tmp"
+DOVECOT_BUILD_INFO=${DOVECOT_BUILD_INFO:-DOVECOT_VERSION_FULL}
 
 abspath()
 { #$1 the path
@@ -45,6 +46,7 @@ if true; then
 #define DOVECOT_VERSION_H
 
 #define DOVECOT_VERSION_FULL VERSION" (${GITID})"
+#define DOVECOT_BUILD_INFO ${DOVECOT_BUILD_INFO}
 
 #endif /* DOVECOT_VERSION_H */
 EOF
@@ -54,6 +56,7 @@ else
 #define DOVECOT_VERSION_H
 
 #define DOVECOT_VERSION_FULL VERSION
+#define DOVECOT_BUILD_INFO ${DOVECOT_BUILD_INFO}
 
 #endif /* DOVECOT_VERSION_H */
 EOF