Skip to content

Commit

Permalink
lib: Add dovecot_build_info variable containing Dovecot build informa…
Browse files Browse the repository at this point in the history
…tion.

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
  • Loading branch information
sirainen authored and villesavolainen committed May 19, 2017
1 parent 88bb978 commit 5fbdfc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/lib.c
@@ -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"
Expand All @@ -13,6 +14,10 @@
#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;

Expand Down
3 changes: 3 additions & 0 deletions update-version.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5fbdfc5

Please sign in to comment.