# HG changeset patch # User Elliott Sales de Andrade # Date 1248510407 0 # Node ID b55fb0a1b0875f5fb7db975b7a72bf84aa1a02b1 # Parent cc8f641d2fdedd2e1b37236a564d42a1182b4a6e# Parent efe680b868118d2daa6693c0b5a09c7e9743f03d merge of '968b860be1d2669d190f0b1376533fcbc0d52b98' and 'ffe78a16627e92e954cce70124f774b9009e60b7' diff -r efe680b86811 -r b55fb0a1b087 Makefile.am --- a/Makefile.am Sat Jul 25 02:55:33 2009 +0000 +++ b/Makefile.am Sat Jul 25 08:26:47 2009 +0000 @@ -16,13 +16,14 @@ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ + package_revision.h \ pidgin.apspec.in \ pidgin.spec.in \ pidgin.desktop.in \ po/Makefile.mingw \ valgrind-suppressions -noinst_HEADERS = config.h +noinst_HEADERS = config.h package_revision.h dist-hook: pidgin.spec cp pidgin.spec $(distdir) @@ -86,7 +87,42 @@ PO_DIR=po endif -SUBDIRS = libpurple doc $(GNT_DIR) $(GTK_DIR) m4macros $(PO_DIR) share/ca-certs share/sounds +# This is phony, so that we always try to rebuild it. If it succeeds +# in calculating changes, it produces its target; otherwise, its +# target does not exist. +.PHONY: package_revision_raw.txt +# if both attempts fail, then we need to remove the empty file that > +# creates, and also make sure that the shell command exits +# successfully; the rm -f ensures both +package_revision_raw.txt: + REAL_BLDDIR=$$PWD/$(top_builddir); \ + (cd $(srcdir) && $$REAL_BLDDIR/mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \ + || (cd $(srcdir) && mtn --root=. automate get_base_revision_id) 2>/dev/null >$@ \ + || rm -f $@ +package_revision.h: package_revision_raw.txt + if [ -f $< ]; then \ + sed 's/^\(.\+\)$$/#define REVISION "\1"/' $< > $@; \ + fi + if [ ! -f $@ -a -f $(srcdir)/$@ ]; then \ + cp $(srcdir)/$@ $@; \ + fi + [ -f $@ ] || echo "#define REVISION \"unknown\"" > $@ + +# This is a magic directive copy-and-pasted, then modified, from the +# automake 1.9 manual, section 13.4, "Checking the distribution". +# Normally, 'distcheck' does a clean build, and then afterwards runs +# 'distclean', and 'distclean' is supposed to remove everything that +# the build created. However, we have some targets (package_revision.txt) +# that we distribute, but then always attempt to rebuild optimistically, and +# then if that fails fall back on the distributed versions. This +# means that 'distclean' should _not_ remove those files, since they +# are distributed, yet building the package will generate those files, +# thus automake thinks that 'distclean' _should_ remove those files, +# and 'distcheck' gets cranky if we don't. So basically what this +# line does is tell 'distcheck' to shut up and ignore those two files. +distcleancheck_listfiles = find . -type f -a ! -name package_revision.h + +SUBDIRS = . libpurple doc $(GNT_DIR) $(GTK_DIR) m4macros $(PO_DIR) share/ca-certs share/sounds docs: Doxyfile if HAVE_DOXYGEN diff -r efe680b86811 -r b55fb0a1b087 finch/finch.c --- a/finch/finch.c Sat Jul 25 02:55:33 2009 +0000 +++ b/finch/finch.c Sat Jul 25 08:26:47 2009 +0000 @@ -48,6 +48,7 @@ #include #include "config.h" +#include "package_revision.h" static void debug_init(void) @@ -314,7 +315,7 @@ if (opt_version) { /* Translators may want to transliterate the name. It is not to be translated. */ - printf("%s %s\n", _("Finch"), DISPLAY_VERSION); + printf("%s %s (%s)\n", _("Finch"), DISPLAY_VERSION, REVISION); return 0; } diff -r efe680b86811 -r b55fb0a1b087 pidgin/gtkdialogs.c --- a/pidgin/gtkdialogs.c Sat Jul 25 02:55:33 2009 +0000 +++ b/pidgin/gtkdialogs.c Sat Jul 25 08:26:47 2009 +0000 @@ -27,6 +27,7 @@ #include "internal.h" #include "pidgin.h" +#include "package_revision.h" #include "debug.h" #include "notify.h" @@ -446,7 +447,7 @@ str = g_string_sized_new(4096); g_string_append_printf(str, - "
%s %s

(libpurple %s)

", PIDGIN_NAME, DISPLAY_VERSION, purple_core_get_version()); + "
%s %s

(libpurple %s)
%s

", PIDGIN_NAME, DISPLAY_VERSION, purple_core_get_version(), REVISION); g_string_append_printf(str, _("%s is a graphical modular messaging client based on "