[SCM] UNNAMED PROJECT - branch master updated -
401fb01f8cb06886e2c5c277a9a70512a9b68579
Ronnie Sahlberg
sahlberg at samba.org
Thu Apr 3 06:10:12 GMT 2008
The branch, master has been updated
via 401fb01f8cb06886e2c5c277a9a70512a9b68579 (commit)
from 10e585413c217d9b9c32ff3d2fb3d8f24183c458 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 401fb01f8cb06886e2c5c277a9a70512a9b68579
Author: Ronnie Sahlberg <sahlberg at samba.org>
Date: Thu Apr 3 17:07:00 2008 +1100
add a ctdb command to print the ctdb version
-----------------------------------------------------------------------
Summary of changes:
packaging/RPM/ctdb.spec | 2 +-
tools/ctdb.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index d51f170..991c6fc 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -39,7 +39,7 @@ CC="gcc"
## always run autogen.sh
./autogen.sh
-CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE" ./configure \
+CFLAGS="$RPM_OPT_FLAGS $EXTRA -O0 -D_GNU_SOURCE -DCTDB_VERS=\"%{version}-%{release}\"" ./configure \
--prefix=%{_prefix} \
--sysconfdir=%{_sysconfdir} \
--mandir=%{_mandir} \
diff --git a/tools/ctdb.c b/tools/ctdb.c
index 397e67a..94e681f 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -40,6 +40,16 @@ static struct {
#define TIMELIMIT() timeval_current_ofs(options.timelimit, 0)
+#ifdef CTDB_VERS
+static int control_version(struct ctdb_context *ctdb, int argc, const char **argv)
+{
+#define STR(x) #x
+#define XSTR(x) STR(x)
+ printf("CTDB version: %s\n", XSTR(CTDB_VERS));
+ return 0;
+}
+#endif
+
/*
see if a process exists
*/
@@ -1561,6 +1571,9 @@ static const struct {
const char *msg;
const char *args;
} ctdb_commands[] = {
+#ifdef CTDB_VERS
+ { "version", control_version, true, "show version of ctdb" },
+#endif
{ "status", control_status, true, "show node status" },
{ "uptime", control_uptime, true, "show node uptime" },
{ "ping", control_ping, true, "ping all nodes" },
--
UNNAMED PROJECT
More information about the samba-cvs
mailing list