--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mcabber/hgcset.sh Sun Mar 26 23:30:21 2006 +0200
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+if [ ! -f logprint.h ]; then
+ echo "You are not in the src directory" >&2
+ exit 1
+fi
+
+if which hg > /dev/null 2>&1; then
+ cs=$(hg id 2> /dev/null | cut -d' ' -f1)
+ if test $? -eq 0; then
+ grep -q "$cs" hgcset.h > /dev/null 2>&1 || \
+ echo "#define HGCSET \"$cs\"" > hgcset.h
+ exit 0
+ fi
+fi
+
+echo > hgcset.h
--- a/mcabber/src/Makefile.am Sat Mar 25 20:01:51 2006 +0100
+++ b/mcabber/src/Makefile.am Sun Mar 26 23:30:21 2006 +0200
@@ -11,5 +11,15 @@
INCLUDES = $(GLIB_CFLAGS)
+BUILT_SOURCES = hgcset.h
+CLEANFILES = hgcset.h
+
+#mcabber_DEPENDENCIES = hgcset.h \
+# ../libjabber/liblibjabber.a ../connwrap/libconnwrap.a
+
+hgcset.h:
+ ../hgcset.sh
+
#SUBDIRS =
+.PHONY: hgcset.h
--- a/mcabber/src/commands.c Sat Mar 25 20:01:51 2006 +0100
+++ b/mcabber/src/commands.c Sun Mar 26 23:30:21 2006 +0200
@@ -1974,7 +1974,9 @@
static void do_version(char *arg)
{
- scr_LogPrint(LPRINT_NORMAL, "This is mcabber version %s.", PACKAGE_VERSION);
+ gchar *ver = mcabber_version();
+ scr_LogPrint(LPRINT_NORMAL, "This is mcabber version %s.", ver);
+ g_free(ver);
}
static void do_request(char *arg)
--- a/mcabber/src/commands.h Sat Mar 25 20:01:51 2006 +0100
+++ b/mcabber/src/commands.h Sun Mar 26 23:30:21 2006 +0200
@@ -17,6 +17,7 @@
int process_command(char *line);
char *expandalias(char *line);
+extern char *mcabber_version(void);
extern void mcabber_connect(void);
#endif /* __COMMANDS_H__ */
--- a/mcabber/src/main.c Sat Mar 25 20:01:51 2006 +0100
+++ b/mcabber/src/main.c Sun Mar 26 23:30:21 2006 +0200
@@ -40,8 +40,20 @@
#include "histolog.h"
#include "hooks.h"
#include "utils.h"
+#include "hgcset.h"
+char *mcabber_version(void)
+{
+ char *ver;
+#ifdef HGCSET
+ ver = g_strdup_printf("%s (%s)", PACKAGE_VERSION, HGCSET);
+#else
+ ver = g_strdup(PACKAGE_VERSION);
+#endif
+ return ver;
+}
+
void mcabber_connect(void)
{
const char *username, *password, *resource, *servername;