Skip to content
Permalink
Browse files

Added short git SHA1 of HEAD to version info

  • Loading branch information...
VOS Maintainer
VOS Maintainer committed Nov 6, 2017
1 parent b87e436 commit cf829c32e570e05b2a3d82e77a2951d1273264c4
Showing with 58 additions and 12 deletions.
  1. +1 −0 .gitignore
  2. +14 −7 binsrc/virtuoso/viunix.c
  3. +13 −4 binsrc/virtuoso/viwin32.c
  4. +8 −0 libsrc/Wi/Makefile.am
  5. +18 −0 libsrc/Wi/mkgit_head.sh
  6. +4 −1 libsrc/Wi/srvstat.c
@@ -83,6 +83,7 @@ docsrc/xmlsource/vspxdoc.xml
libsrc/Wi/json_l.c
libsrc/Wi/json_p.c
libsrc/Wi/json_p.h
libsrc/Wi/git_head.c
libsrc/Wi/nquad_p.c
libsrc/Wi/nquad_p.h
libsrc/Wi/nquad_p.output
@@ -486,21 +486,29 @@ usage (void)
char version[400];
char line[200];
char *p;
extern char *git_head;

sprintf (line, "%s %s\n", PACKAGE_NAME,
build_thread_model[0] == '-' && build_thread_model[1] == 'f' ?
PACKAGE_FIBER : PACKAGE_THREAD);
build_thread_model[0] == '-' && build_thread_model[1] == 'f' ? PACKAGE_FIBER : PACKAGE_THREAD);
p = stpcpy (version, line);

sprintf (line, "Version %s.%s%s%s as of %s\n",
sprintf (line, "Version %s.%s%s%s as of %s",
PACKAGE_VERSION, DBMS_SRV_GEN_MAJOR, DBMS_SRV_GEN_MINOR, build_thread_model, build_date);
p = stpcpy (p, line);

sprintf (line, "Compiled for %s (%s)\n", build_opsys_id, build_host_id);
p = stpcpy (p, line);
/*
* Add git SHA1 of HEAD for easier identification of code base
*/
if (git_head[0])
{
sprintf (line, " (%s)", git_head);
p = stpcpy (p, line);
}

sprintf (line, "\nCompiled for %s (%s)\n", build_opsys_id, build_host_id);
p = stpcpy (p, line);

if (build_special_server_model && strlen(build_special_server_model) > 1)
if (build_special_server_model && strlen (build_special_server_model) > 1)
{
sprintf (line, "Hosted Runtime Environments: %s\n", build_special_server_model);
p = stpcpy (p, line);
@@ -516,7 +524,6 @@ usage (void)
call_exit (1);
}


void db_not_in_use (void);

void
@@ -1243,20 +1243,29 @@ usage (void)
char version[400];
char line[200];
char *p;
extern char *git_head;
#if LICENSE
int lic;
#endif

sprintf (line, "%s %s\n", PACKAGE_NAME,
build_thread_model[0] == '-' && build_thread_model[1] == 'f' ?
PACKAGE_FIBER : PACKAGE_THREAD);
build_thread_model[0] == '-' && build_thread_model[1] == 'f' ? PACKAGE_FIBER : PACKAGE_THREAD);
p = stpcpy (version, line);

sprintf (line, "Version %s.%s%s%s as of %s\n",
sprintf (line, "Version %s.%s%s%s as of %s",
PACKAGE_VERSION, DBMS_SRV_GEN_MAJOR, DBMS_SRV_GEN_MINOR, build_thread_model, build_date);
p = stpcpy (p, line);

sprintf (line, "Compiled for %s (%s)\n", build_opsys_id, build_host_id);
/*
* Add git SHA1 of HEAD for easier identification of code base
*/
if (git_head[0])
{
sprintf (line, " (%s)", git_head);
p = stpcpy (p, line);
}

sprintf (line, "\nCompiled for %s (%s)\n", build_opsys_id, build_host_id);
p = stpcpy (p, line);

if (build_special_server_model && strlen(build_special_server_model) > 1)
@@ -67,6 +67,7 @@ noinst_HEADERS = \


generated_code = \
git_head.c \
json_l.c \
json_p.c \
json_p.h \
@@ -184,6 +185,7 @@ libwi_la_SOURCES = \
eqlcomp.c \
extent.c \
gate.c \
git_head.c \
hash.c \
hosting.c \
http.c \
@@ -332,6 +334,7 @@ libwi_odbc_la_SOURCES = \
eqlcomp.c \
extent.c \
gate.c \
git_head.c \
hash.c \
hosting.c \
http.c \
@@ -751,6 +754,9 @@ SQL_FILES_WS = \
$(top_srcdir)/binsrc/vspx/vspx.xsl


git_head.c:FORCE
@-$(SHELL) ./mkgit_head.sh

json_p.c json_p.h: $(srcdir)/json.y Makefile.am
@$(GEN) $(YACC) -o json_p.c -vd -pjsonyy $(srcdir)/json.y

@@ -1087,3 +1093,5 @@ EXTRA_DIST = \
sparqlwords.gperf \
ssl.c \
string_tmpl.c

FORCE:
@@ -0,0 +1,18 @@
#!/bin/bash

VALUE=000000

if test \! -f git_head.c
then
echo "char * git_head = \"$VALUE\";" > git_head.c
fi

VALUE=`git rev-parse --verify HEAD --short` || exit

echo "char * git_head = \"$VALUE\";" > git_head.c.new

cmp git_head.c git_head.c.new >/dev/null 2>/dev/null || mv git_head.c.new git_head.c

rm -f git_head.c.new

exit 0
@@ -64,7 +64,7 @@
#endif



extern char *git_head;
long tc_try_land_write;
long tc_try_land_reset;
long tc_up_transit_parent_change;
@@ -1721,6 +1721,9 @@ stat_desc_t stat_descs [] =
{"sqlc_add_views_qualifiers", &sqlc_add_views_qualifiers, NULL},

{"db_ver_string", NULL, &db_version_string},
#ifdef unix
{"git_head", NULL, &git_head},
#endif
{"db_max_col_bytes", &db_max_col_bytes, NULL},
{"db_sizeof_wide_char", &db_sizeof_wide_char, NULL},

0 comments on commit cf829c3

Please sign in to comment.
You can’t perform that action at this time.