[gnome-talos] meta: Add a version string



commit 740f0053d9dc7f14d923db1bbaa3d2d426b999b5
Author: Colin Walters <walters verbum org>
Date:   Fri Sep 23 15:42:55 2011 -0400

    meta: Add a version string

 configure.ac                 |   10 ++++++++++
 src/gnome-talos-meta.c       |    3 +++
 src/gnome-talos-version.h.in |   27 +++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9012a31..58f80b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,16 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 AC_PROG_CC
 AM_PROG_CC_C_O
 
+AC_PATH_PROG(GIT, [git])
+GIT_VERSION=
+if test x$GIT != x && test -d ${srcdir}/.git; then
+	GIT_VERSION=`cd ${srcdir} && git describe`
+	GIT_VERSION="git $GIT_VERSION"
+else
+	GIT_VERSION="tar $VERSION"
+fi
+AC_DEFINE_UNQUOTED([GIT_VERSION], "$GIT_VERSION", [Output of git describe if available])
+
 # Initialize libtool
 LT_PREREQ([2.2.6])
 LT_INIT([disable-static])
diff --git a/src/gnome-talos-meta.c b/src/gnome-talos-meta.c
index b8ad114..37b1ab9 100644
--- a/src/gnome-talos-meta.c
+++ b/src/gnome-talos-meta.c
@@ -50,6 +50,9 @@ gnome_talos_acquire_meta (void)
   g_free (checksum);
 
   g_variant_builder_add (&builder, "{sv}",
+			 "version",
+			 g_variant_new_string (GIT_VERSION));
+  g_variant_builder_add (&builder, "{sv}",
 			 "mypid",
 			 g_variant_new_int64 ((gint64)getpid ()));
   g_variant_builder_add (&builder, "{sv}",
diff --git a/src/gnome-talos-version.h.in b/src/gnome-talos-version.h.in
new file mode 100644
index 0000000..5d4b576
--- /dev/null
+++ b/src/gnome-talos-version.h.in
@@ -0,0 +1,27 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Colin Walters <walters verbum org>
+ */
+
+#ifndef __GNOME_TALOS_VERSION__
+#define __GNOME_TALOS_VERSION__ 1
+
+#define GNOME_TALOS_VERSION "gnome-talos @GNOME_TALOS_VERSION@"
+
+#endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]