[Gnucash-changes] r14427 - gnucash/trunk - Allow building from either SVN or SVK
Derek Atkins
warlord at cvs.gnucash.org
Sat Jun 24 14:34:36 EDT 2006
Author: warlord
Date: 2006-06-24 14:34:35 -0400 (Sat, 24 Jun 2006)
New Revision: 14427
Trac: http://svn.gnucash.org/trac/changeset/14427
Added:
gnucash/trunk/util/
gnucash/trunk/util/glade-fixup
gnucash/trunk/util/gnc-svnversion
Removed:
gnucash/trunk/glade-fixup
Modified:
gnucash/trunk/Makefile.am
gnucash/trunk/configure.in
gnucash/trunk/src/gnome-utils/Makefile.am
Log:
Allow building from either SVN or SVK
- create gnc-svnversion script that builds the revision number
from either SVN or SVK. The script should fail gracefully if
you don't have SVK installed
- convert the configure script to use the new gnc-svnversion script
- convert the splash-screen Makefile to use the gnc-svnversions script
Modified: gnucash/trunk/Makefile.am
===================================================================
--- gnucash/trunk/Makefile.am 2006-06-24 16:12:18 UTC (rev 14426)
+++ gnucash/trunk/Makefile.am 2006-06-24 18:34:35 UTC (rev 14427)
@@ -75,7 +75,8 @@
po/glossary/zh_TW.po \
intltool-extract.in \
intltool-merge.in \
- intltool-update.in
+ intltool-update.in \
+ util/gnc-svnversion
bin_SCRIPTS = gnucash-config
Modified: gnucash/trunk/configure.in
===================================================================
--- gnucash/trunk/configure.in 2006-06-24 16:12:18 UTC (rev 14426)
+++ gnucash/trunk/configure.in 2006-06-24 18:34:35 UTC (rev 14427)
@@ -2024,19 +2024,15 @@
#warnFLAGS="${warnFLAGS} -Werror-implicit-function-declaration" # In -Wall
# error-on-warning should not be active in (stable) release tarballs
- if test -h ${srcdir}/Makefile.am
- then
- tmp_srcdir=`readlink ${srcdir}/Makefile.am`
- real_srcdir="${srcdir}/`dirname ${tmp_srcdir}`"
- else
- real_srcdir=${srcdir}
- fi
- if test -d ${real_srcdir}/.svn
+ ${srcdir}/util/gnc-svnversion ${srcdir} >/dev/null 2>&1
+ if test $? = 0
then
- # This code is from SVN, so enable error-on-warning
+ # This code is from SVN/SVK, so enable error-on-warning
+ AC_MSG_WARN([SVN Build: error-on-warning defaults to yes])
error_on_warning_as_default="yes"
else
# This is from a tarball, so disable error-on-warning
+ AC_MSG_WARN([Tarball Build: error-on-warning defaults to no])
error_on_warning_as_default="no"
fi
Deleted: gnucash/trunk/glade-fixup
===================================================================
--- gnucash/trunk/glade-fixup 2006-06-24 16:12:18 UTC (rev 14426)
+++ gnucash/trunk/glade-fixup 2006-06-24 18:34:35 UTC (rev 14427)
@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Remove entries that are for post-gtk2.4 attributes. Glade on a
-# gtk2.4 system will complain when unknown attributes are present on a
-# widget.
-#
-# This script should be run from the top-level source directory before
-# committing changed glade files.
-#
-
-if test -d src ; then
- SEARCHDIRS=src
-else
- SEARCHDIRS=.
-fi
-
-find ${SEARCHDIRS} -name \*.glade | xargs \
- sed -i -e '/name="focus_on_map"/d' \
- -e '/name="ellipsize"/d' \
- -e '/name="width_chars"/d' \
- -e '/name="single_line_mode"/d' \
- -e '/name="urgency_hint"/d' \
- -e '/name="hover_expand"/d' \
- -e '/name="hover_selection"/d' \
- -e '/name="add_tearoffs"/d' \
- -e '/name="angle"/d'
Modified: gnucash/trunk/src/gnome-utils/Makefile.am
===================================================================
--- gnucash/trunk/src/gnome-utils/Makefile.am 2006-06-24 16:12:18 UTC (rev 14426)
+++ gnucash/trunk/src/gnome-utils/Makefile.am 2006-06-24 18:34:35 UTC (rev 14427)
@@ -264,15 +264,10 @@
-rm -f _gnc-svninfo.h
_gnc-svninfo.h: Makefile
- @s=${srcdir} ; \
- if [ -h ${srcdir}/Makefile.am ] ; then \
- d=`readlink $(srcdir)/Makefile.am` ; \
- s="${srcdir}/`dirname $$d`" ; \
- fi ; \
- if [ -d $$s/.svn ] ; then \
- svninfo=`svnversion $$s` ; \
+ @svninfo=`${top_srcdir}/util/gnc-svnversion ${srcdir}` ; \
+ if [ $$? = 0 ] ; then \
if [ -z "$$svninfo" ] ; then \
- echo "svnversion failed. figure out why." ; \
+ echo "gnc-svnversion failed. figure out why." ; \
echo "can't determine svn revision from $$s." ; \
exit 1 ; \
fi ; \
Copied: gnucash/trunk/util/glade-fixup (from rev 13479, gnucash/trunk/glade-fixup)
Added: gnucash/trunk/util/gnc-svnversion
===================================================================
--- gnucash/trunk/util/gnc-svnversion 2006-06-24 16:12:18 UTC (rev 14426)
+++ gnucash/trunk/util/gnc-svnversion 2006-06-24 18:34:35 UTC (rev 14427)
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# Usage:
+# gnc-svnversion <srcdir>
+#
+# Prints the revision number to stdout and exits 0 on success
+# exits with errorcode 1 if we're not in an svn or svk checkout
+#
+# Written By: Derek Atkins <derek at ihtfp.com>
+#
+# $Id$
+
+# Print an error message and then exit
+my_die()
+{
+ echo "$1"
+ exit 1
+}
+
+# Make sure we have a srcdir
+[ -n "$1" ] || my_die "Usage: $0 <srcdir>"
+[ -d "$1" ] || my_die "$0: $1: not a directory"
+
+# Find the real srcdir.
+# This handles the case of a symlink (lndir) tree
+# $real_srcdir will hold the actual source dir
+if test -h "$1"/Makefile.am
+then
+ tmp_srcdir=`readlink "$1"/Makefile.am`
+ real_srcdir="$1/`dirname ${tmp_srcdir}`"
+else
+ real_srcdir="$1"
+fi
+
+# Test if this code is an SVN Checkout
+# If this is an svn checkout we assume you have svnversion!
+if test -d "${real_srcdir}"/.svn
+then
+ svnversion "$real_srcdir"
+ exit $?
+fi
+
+# If we get here then this is NOT an svn checkout. Maybe it's
+# SVK? First, check if we've got 'svk' in the path. If not,
+# then exit with an error code of 1..
+which svk >/dev/null 2>&1
+if test $? != 0 ; then exit 1 ; fi
+
+# Okay, we have 'svk'. Now see if $real_srcdir is an svk checkout
+svkinfo=`svk info "$real_srcdir" 2>&1`
+if test $? != 0 ; then exit 1 ; fi
+
+# If we got here, then $real_srcdir is an svk checkout. Parse out
+# the revision info, print it out, and then output 0. Just combine
+# all the revision numbers into a single string by combining them
+# with periods.
+svkinfo=`svk info "$real_srcdir" | grep Rev | sed -e 's/^.* \([0-9:]*\)$/\1/'`
+echo $svkinfo | sed -e 's/\s/./g'
+
+exit 0
Property changes on: gnucash/trunk/util/gnc-svnversion
___________________________________________________________________
Name: svn:executable
+ *
More information about the gnucash-changes
mailing list