From ebce8a94938198be7e676da8d8ab70f6960f176c Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Fri, 11 May 2018 16:16:38 +0200 Subject: adding --version info --- configure.ac | 23 ++++++++++++++++++++++ .../taler-merchant-generate-payments_new.c | 5 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5fee56d6..3d57949f 100644 --- a/configure.ac +++ b/configure.ac @@ -273,6 +273,29 @@ AC_ARG_ENABLE([logging], ], []) AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise]) +# version info +AC_PATH_PROG(gitcommand, git) +AC_MSG_CHECKING(for source being under a VCS) +git_version= +AS_IF([test ! "X$gitcommand" = "X"], +[ + git_version=$(cd $srcdir ; git rev-list --full-history --all --abbrev-commit | head -n 1 2>/dev/null) +]) +AS_IF([test "X$git_version" = "X"], + [ + vcs_name="no" + vcs_version="\"release\"" + ], + [ + vcs_name="yes, git-svn" + vcs_version="\"git-$git_version\"" + ]) +AC_MSG_RESULT($vcs_name) + +AC_MSG_CHECKING(VCS version) +AC_MSG_RESULT($vcs_version) +AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version]) + # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T AC_TYPE_SIZE_T diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c b/src/merchant-tools/taler-merchant-generate-payments_new.c index f9a5eb13..4ccb263d 100644 --- a/src/merchant-tools/taler-merchant-generate-payments_new.c +++ b/src/merchant-tools/taler-merchant-generate-payments_new.c @@ -277,8 +277,11 @@ main (int argc, struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_option_version + (PACKAGE_VERSION " " VCS_VERSION), + GNUNET_GETOPT_option_help - ("Generate Taler payments to populate the database(s)"), + ("Generate Taler payments to populate the database(s)"), GNUNET_GETOPT_option_uint ('n', -- cgit v1.2.3