Skip to content

Commit

Permalink
show git hash in version information
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Feb 25, 2024
1 parent ea13d0d commit b91e292
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ if test "$USEPERL" = "yes"; then
AC_SUBST(PERLLIBS)
fi

##############################################
AC_DEFINE_UNQUOTED([GIT_HASH], "`git describe --always 2>/dev/null`", ["git version information"])

##############################################
AM_CONDITIONAL(USEBSD, test "$(uname)" = "FreeBSD")

Expand Down
5 changes: 4 additions & 1 deletion neb_module_naemon/mod_gearman.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ int nebmodule_init( int flags, char *args, nebmodule *handle ) {
if ( mod_gm_opt->logmode != GM_LOG_MODE_CORE ) {
int logmode_saved = mod_gm_opt->logmode;
mod_gm_opt->logmode = GM_LOG_MODE_CORE;
gm_log( GM_LOG_INFO, "initialized version %s (libgearman %s)\n", GM_VERSION, gearman_version() );
if(strlen(GIT_HASH) > 0)
gm_log( GM_LOG_INFO, "initialized version %s (build: %s) (libgearman %s)\n", GM_VERSION, GIT_HASH, gearman_version() );
else
gm_log( GM_LOG_INFO, "initialized version %s (libgearman %s)\n", GM_VERSION, gearman_version() );
mod_gm_opt->logmode = logmode_saved;
}

Expand Down

0 comments on commit b91e292

Please sign in to comment.