From 27c76eccd59d32428abccf58c014e517207bfcca Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 31 Oct 2012 21:38:49 +0000 Subject: [PATCH] Minor changes to indicate svn is not the only/primary vcs used. The code actually has provisions for svn, svk, git and bzr. Only svn and git are actively used by the core developers though. This involves changing - filenames that contained svn while meant for multiple vcs's - variable and macro names that are relevant for multiple vcs's - the various locations where the vcs revision info is displayed to the user, to mention the actual vcs used instead of standard "svn" While at the last item, I also changed the text printed when gnucash is called with the --version parameter, to reuse the translatable string that is also used for the about dialog. This saves us one string to translate. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22475 57a11ea4-9604-0410-9ed3-97b8803252fd --- Makefile.am | 4 +- configure.ac | 32 +++---- intl-scm/Makefile.am | 2 +- packaging/win32/build_package.sh | 4 +- packaging/win32/build_package_git.sh | 4 +- packaging/win32/defaults.sh | 8 +- packaging/win32/dist-impl.sh | 2 +- packaging/win32/install-impl.sh | 6 +- packaging/win32/install.sh | 2 +- packaging/win32/reset.sh | 1 + src/Makefile.am | 2 +- src/app-utils/Makefile.am | 2 +- src/bin/gnucash-bin.c | 31 ++++--- src/bin/gnucash-strip-svn-datafile.sh | 4 +- src/core-utils/Makefile.am | 50 +++++------ src/core-utils/gnc-main.h | 2 - src/doc/python-bindings-doxygen.py | 9 +- src/engine/Makefile.am | 2 +- src/gnc-module/Makefile.am | 2 +- src/gnc-module/test/mod-bar/Makefile.am | 2 +- src/gnc-module/test/mod-baz/Makefile.am | 2 +- src/gnc-module/test/mod-foo/Makefile.am | 2 +- src/gnc/main.cpp | 4 +- src/gnome-utils/Makefile.am | 2 +- src/gnome-utils/gnc-main-window.c | 18 ++-- src/gnome-utils/gnc-splash.c | 18 ++-- src/gnome/Makefile.am | 2 +- src/html/Makefile.am | 2 +- src/optional/python-bindings/Makefile.am | 2 +- src/optional/python-bindings/gnucash_core.py | 4 +- src/pixmaps/Makefile.am | 6 +- src/report/report-gnome/Makefile.am | 2 +- src/report/report-system/Makefile.am | 2 +- src/test-core/Makefile.am | 2 +- util/{gnc-svnversion => gnc-vcs-info} | 87 ++++++++++++++++---- 35 files changed, 200 insertions(+), 126 deletions(-) rename util/{gnc-svnversion => gnc-vcs-info} (67%) diff --git a/Makefile.am b/Makefile.am index a6deef3091..fc108fbdbf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -77,7 +77,7 @@ EXTRA_DIST = \ intltool-extract.in \ intltool-merge.in \ intltool-update.in \ - util/gnc-svnversion + util/gnc-vcs-info ## We borrow guile's convention and use @-...-@ as the substitution ## brackets here, instead of the usual @...@. This prevents autoconf @@ -186,7 +186,7 @@ intl-scm/guile-strings.c: SVN = svn XSLTPROC = xsltproc -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS # This rule will generate a ChangeLog of gnucash/trunk commits, plus # all additional branches that are added in # ./macros/svn2cl.xsl. (FIXME: Is the dependency on NEWS really a good diff --git a/configure.ac b/configure.ac index baee63fdd6..779009f4b4 100644 --- a/configure.ac +++ b/configure.ac @@ -174,39 +174,39 @@ if test x$am_cv_scanf_lld = "xno"; then fi fi -# test whether we are building directly from SVN/SVK -${srcdir}/util/gnc-svnversion ${srcdir} >/dev/null 2>&1 -if test $? = 0 -o "x${BUILDING_FROM_SVN}" = "xyes" ; then - BUILDING_FROM_SVN=yes +# test whether we are building directly from svn/svk/git/bzr +${srcdir}/util/gnc-vcs-info -r ${srcdir} >/dev/null 2>&1 +if test $? = 0 -o "x${BUILDING_FROM_VCS}" = "xyes" ; then + BUILDING_FROM_VCS=yes # We need at least version 1.3.31 of SWIG because # that's when SWIG doesn't barf on the "inline" keyword in C headers anymore AC_PROG_SWIG(1.3.31) else - BUILDING_FROM_SVN=no - # Make sure we've got swig-runtime.h and gnc-svninfo.h + BUILDING_FROM_VCS=no + # Make sure we've got swig-runtime.h and gnc-vcs-info.h AC_CHECK_FILE(${srcdir}/src/swig-runtime.h, [], [AC_MSG_ERROR([ -It looks like you are NOT building from Subversion -but I cannot find swig-runtime.h. Check your PATH -and make sure we can find svnversion in your PATH! +It looks like you are NOT building from Subversion, svk, git or bzr +but I cannot find swig-runtime.h. Check your PATH and make sure +we can find gnc-vcs-info in your PATH! Either that or contact gnucash-devel@gnucash.org because the tarball you downloaded is broken. ])]) - AC_CHECK_FILE(${srcdir}/src/core-utils/gnc-svninfo.h, [], + AC_CHECK_FILE(${srcdir}/src/core-utils/gnc-vcs-info.h, [], [AC_MSG_ERROR([ -It looks like you are NOT building from Subversion -but I cannot find gnc-svninfo.h. Check your PATH -and make sure we can find svnversion in your PATH! +It looks like you are NOT building from Subversion, svk, git or bzr +but I cannot find gnc-vcs-info.h. Check your PATH and make sure +we can find gnc-vcs-info in your PATH! Either that or contact gnucash-devel@gnucash.org because the tarball you downloaded is broken. ])]) fi -AM_CONDITIONAL(BUILDING_FROM_SVN, test "x$BUILDING_FROM_SVN" = "xyes") +AM_CONDITIONAL(BUILDING_FROM_VCS, test "x$BUILDING_FROM_VCS" = "xyes") # Build dir adjustments AM_CONDITIONAL(GNUCASH_SEPARATE_BUILDDIR, test "x${srcdir}" != "x.") @@ -1112,9 +1112,9 @@ then #warnFLAGS="${warnFLAGS} -Werror-implicit-function-declaration" # In -Wall # error-on-warning should not be active in (stable) release tarballs - if test "x$BUILDING_FROM_SVN" = "xyes" + if test "x$BUILDING_FROM_VCS" = "xyes" then - # This code is from SVN/SVK, so enable error-on-warning + # This code is from svn/svk/git/bzr, so enable error-on-warning error_on_warning_as_default="yes" else # This is from a tarball, so disable error-on-warning diff --git a/intl-scm/Makefile.am b/intl-scm/Makefile.am index 18c2c7ced1..47c54a9481 100644 --- a/intl-scm/Makefile.am +++ b/intl-scm/Makefile.am @@ -12,7 +12,7 @@ BUILT_SOURCES = guile-strings.c SCMFILES = $(shell find ${abs_top_srcdir}/src -name test -prune -o -name '*.scm' -print | sort) -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS # This needs to be generated in srcdir guile-strings.c: $(SCMFILES) rm -f guile-strings.c diff --git a/packaging/win32/build_package.sh b/packaging/win32/build_package.sh index b25fd8d1a9..797f500a4a 100644 --- a/packaging/win32/build_package.sh +++ b/packaging/win32/build_package.sh @@ -65,12 +65,12 @@ rm -rf ${_DIST_UDIR} _BUILD_UDIR=`unix_path $BUILD_DIR` _GNUCASH_UDIR=`unix_path $GNUCASH_DIR` PKG_VERSION=`grep PACKAGE_VERSION ${_BUILD_UDIR}/config.h | cut -d" " -f3 | cut -d\" -f2 ` -SVN_REV=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/core-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` +GNC_VCS_REV=`grep GNUCASH_VCS_REV ${_BUILD_UDIR}/src/core-utils/gnc-vcs-info.h | cut -d" " -f3 | cut -d\" -f2 ` # Choose the output filename based on our "build_from_tarball" setting # Make sure this logic matches the logic in dist.sh! if [ "$BUILD_FROM_TARBALL" = "no" ]; then - SETUP_FILENAME="gnucash-${PKG_VERSION}-svn-r${SVN_REV}-setup.exe" + SETUP_FILENAME="gnucash-${PKG_VERSION}-svn-r${GNC_VCS_REV}-setup.exe" else SETUP_FILENAME="gnucash-${PKG_VERSION}-setup.exe" fi diff --git a/packaging/win32/build_package_git.sh b/packaging/win32/build_package_git.sh index 62254e3441..cc061626e1 100644 --- a/packaging/win32/build_package_git.sh +++ b/packaging/win32/build_package_git.sh @@ -23,7 +23,7 @@ function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; } . functions.sh . defaults.sh -tag="${1:-$GIT_REV}" +tag="${1:-$GNC_VCS_REV}" # Determine where to upload to # NOTE: this assumes "tag" to be either a tag or a branch, not a @@ -69,7 +69,7 @@ rm -rf ${_DIST_UDIR} _BUILD_UDIR=`unix_path $BUILD_DIR` _GNUCASH_UDIR=`unix_path $GNUCASH_DIR` PKG_VERSION=`grep PACKAGE_VERSION ${_BUILD_UDIR}/config.h | cut -d" " -f3 | cut -d\" -f2 ` -REVISION=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/core-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` +REVISION=`grep GNUCASH_VCS_REV ${_BUILD_UDIR}/src/core-utils/gnc-vcs-info.h | cut -d" " -f3 | cut -d\" -f2 ` # Choose the output filename based on our "build_from_tarball" setting # Make sure this logic matches the logic in dist.sh! diff --git a/packaging/win32/defaults.sh b/packaging/win32/defaults.sh index 4ddfcbf7b0..1e4f5b3e46 100644 --- a/packaging/win32/defaults.sh +++ b/packaging/win32/defaults.sh @@ -42,11 +42,11 @@ else set_default REPOS_TYPE "git" if [ "$REPOS_TYPE" = "git" ]; then - set_default GIT_REV "trunk" + set_default GNC_VCS_REV "trunk" set_default REPOS_URL "git://github.com/Gnucash/gnucash.git" elif [ "$REPOS_TYPE" = "svn" ]; then # latest revision that should compile, use HEAD or vwxyz - set_default SVN_REV "HEAD" + set_default GNC_VCS_REV "HEAD" set_default REPOS_URL "http://svn.gnucash.org/repo/gnucash/trunk" fi fi @@ -409,11 +409,11 @@ set_default CMAKE_DIR $GLOBAL_DIR\\cmake set_default DOCBOOK_XSL_URL "$SF_MIRROR/docbook/docbook-xsl-1.76.1.zip" set_default DOCBOOK_DTD_URL "http://www.oasis-open.org/docbook/xml/4.1.2/docbkx412.zip" if [ "$REPOS_TYPE" = "git" ]; then - set_default DOCS_REV "trunk" + set_default DOCS_VCS_REV "trunk" set_default DOCS_URL "git://github.com/Gnucash/gnucash-docs.git" elif [ "$REPOS_TYPE" = "svn" ]; then # latest revision that should compile, use HEAD or vwxyz - set_default DOCS_REV "HEAD" + set_default DOCS_VCS_REV "HEAD" set_default DOCS_URL "http://svn.gnucash.org/repo/gnucash-docs/trunk" fi set_default UPDATE_DOCS yes diff --git a/packaging/win32/dist-impl.sh b/packaging/win32/dist-impl.sh index 9a41003f59..a10e29c16c 100755 --- a/packaging/win32/dist-impl.sh +++ b/packaging/win32/dist-impl.sh @@ -297,7 +297,7 @@ function dist_finish() { if [ "$BUILD_FROM_TARBALL" = "no" ]; then # And changing output filename PKG_VERSION=`grep PACKAGE_VERSION ${_BUILD_UDIR}/config.h | cut -d" " -f3 | cut -d\" -f2 ` - REVISION=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/core-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` + REVISION=`grep GNUCASH_VCS_REV ${_BUILD_UDIR}/src/core-utils/gnc-vcs-info.h | cut -d" " -f3 | cut -d\" -f2 ` if [ "$REPOS_TYPE" = "svn" ]; then SETUP_FILENAME="gnucash-${PKG_VERSION}-${REPOS_TYPE}-r${REVISION}-setup.exe" else diff --git a/packaging/win32/install-impl.sh b/packaging/win32/install-impl.sh index 1cb2bab0f9..9fa40124fb 100644 --- a/packaging/win32/install-impl.sh +++ b/packaging/win32/install-impl.sh @@ -1582,10 +1582,10 @@ function checkupd_docs_svn() { if [ "$UPDATE_DOCS" = "yes" ]; then if [ -x .svn ]; then setup "Docs - Update repository (svn)" - svn up -r $DOCS_REV + svn up -r $DOCS_VCS_REV else setup "Docs - Checkout repository (svn)" - svn co -r $DOCS_REV $DOCS_URL . + svn co -r $DOCS_VCS_REV $DOCS_URL . fi fi } @@ -1599,7 +1599,7 @@ function checkupd_docs_git() { else setup "Docs - Checkout repository (git)" $GIT_CMD clone $DOCS_URL . - $GIT_CMD checkout $DOCS_REV + $GIT_CMD checkout $DOCS_VCS_REV fi fi } diff --git a/packaging/win32/install.sh b/packaging/win32/install.sh index 024fe84ee0..bacc5fb8b4 100644 --- a/packaging/win32/install.sh +++ b/packaging/win32/install.sh @@ -83,7 +83,7 @@ add_step inst_gnome add_step inst_guile if [ "$CROSS_COMPILE" != "yes" ]; then add_step inst_svn -add_step inst_git + add_step inst_git fi add_step inst_gnutls add_step inst_libxslt diff --git a/packaging/win32/reset.sh b/packaging/win32/reset.sh index a19ca91777..b0b5ca104a 100644 --- a/packaging/win32/reset.sh +++ b/packaging/win32/reset.sh @@ -26,6 +26,7 @@ function add_precious_path() { add_precious_path msys $MSYS_DIR add_precious_path wget $WGET_DIR add_precious_path svn $SVN_DIR +add_precious_path git $GIT_DIR add_precious_path repos $REPOS_DIR add_precious_path hh $HH_DIR diff --git a/src/Makefile.am b/src/Makefile.am index 5dada8c400..d021a6e4ed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,7 +53,7 @@ noinst_HEADERS = \ noinst_DATA = gnc-test-env -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-runtime.h: $(SWIG) -guile -external-runtime $@ endif diff --git a/src/app-utils/Makefile.am b/src/app-utils/Makefile.am index 7de86e55a3..82c0ef9b83 100644 --- a/src/app-utils/Makefile.am +++ b/src/app-utils/Makefile.am @@ -93,7 +93,7 @@ libgncmod_app_utils_la_LIBADD = \ ${GUILE_LIBS} \ ${GLIB_LIBS} -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-app-utils-guile.c: app-utils.i ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< diff --git a/src/bin/gnucash-bin.c b/src/bin/gnucash-bin.c index 004489017c..e1ab3e6d6f 100644 --- a/src/bin/gnucash-bin.c +++ b/src/bin/gnucash-bin.c @@ -65,8 +65,8 @@ static QofLogModule log_module = GNC_MOD_GUI; # include #endif -/* GNUCASH_SVN is defined whenever we're building from an SVN tree */ -#ifdef GNUCASH_SVN +/* GNUCASH_VCS is defined whenever we're building from an svn/svk/git/bzr tree */ +#ifdef GNUCASH_VCS static int is_development_version = TRUE; #else static int is_development_version = FALSE; @@ -520,21 +520,32 @@ gnc_parse_command_line(int *argc, char ***argv) if (gnucash_show_version) { + gchar *fixed_message; + if (is_development_version) { - /* Translators: %s is the version number */ - g_print(_("GnuCash %s development version"), VERSION); + fixed_message = g_strdup_printf(_("GnuCash %s development version"), VERSION); + + /* Translators: 1st %s is a fixed message, which is translated independently; + 2nd %s is the vcs type (svn/svk/git/bzr); + 3rd %s is the vcs revision number; + 4th %s is the build date */ + g_print ( _("%s\nThis copy was built from %s rev %s on %s."), + fixed_message, GNUCASH_VCS, GNUCASH_VCS_REV, + GNUCASH_BUILD_DATE ); } else { - /* Translators: %s is the version number */ - g_print(_("GnuCash %s"), VERSION); + fixed_message = g_strdup_printf(_("GnuCash %s"), VERSION); + + /* Translators: 1st %s is a fixed message, which is translated independently; + 2nd %s is the vcs (svn/svk/git/bzr) revision number; + 3rd %s is the build date */ + g_print ( _("%s\nThis copy was built from rev %s on %s."), + fixed_message, GNUCASH_VCS_REV, GNUCASH_BUILD_DATE ); } g_print("\n"); - /* Translators: 1st %s is the build date; 2nd %s is the SVN - revision number */ - g_print(_("Built %s from r%s"), GNUCASH_BUILD_DATE, GNUCASH_SVN_REV); - g_print("\n"); + g_free (fixed_message); exit(0); } diff --git a/src/bin/gnucash-strip-svn-datafile.sh b/src/bin/gnucash-strip-svn-datafile.sh index 5c1a3c7d80..dfea99902f 100755 --- a/src/bin/gnucash-strip-svn-datafile.sh +++ b/src/bin/gnucash-strip-svn-datafile.sh @@ -1,12 +1,12 @@ #!/bin/sh # This script strips data elements from a gnucash data file that have -# been introduced in the SVN-trunk version of gnucash, but are not +# been introduced in the trunk version of gnucash, but are not # backwards-compatible to older versions of gnucash. ORIGFILE=$1 ORIGTMPFILE="${ORIGFILE}.gunzip" -BKUPFILE="${ORIGFILE}.svn.gz" +BKUPFILE="${ORIGFILE}.bkp.gz" TMPFILE="${ORIGFILE}.tmp" if [ -f ${ORIGFILE} ] ; then diff --git a/src/core-utils/Makefile.am b/src/core-utils/Makefile.am index 52f190a024..d68393c86b 100644 --- a/src/core-utils/Makefile.am +++ b/src/core-utils/Makefile.am @@ -40,7 +40,7 @@ noinst_HEADERS = \ gnc-path.h \ gnc-uri-utils.h -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-core-utils-guile.c: core-utils.i ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< @@ -107,7 +107,7 @@ endif noinst_DATA = .scm-links BUILT_SOURCES = gncla-dir.h gnc-version.h -EXTRA_DIST = $(gncmod_DATA) core-utils.i gncla-dir.h.in gnc-svninfo.h +EXTRA_DIST = $(gncmod_DATA) core-utils.i gncla-dir.h.in gnc-vcs-info.h clean-local: rm -rf gnucash @@ -136,39 +136,39 @@ gnc-version.h: _gnc-version.h -cmp -s _gnc-version.h gnc-version.h || cp _gnc-version.h gnc-version.h -rm -f _gnc-version.h -_gnc-version.h: gnc-svninfo.h Makefile - @echo "/* Autogenerated. Do not change. */" > _gnc-version.h - @echo "#ifndef GNC_VERSION_H" >> _gnc-version.h - @echo "#define GNC_VERSION_H" >> _gnc-version.h - @echo "" >> _gnc-version.h - @svninfo=`${top_srcdir}/util/gnc-svnversion ${top_srcdir}` ; \ +_gnc-version.h: gnc-vcs-info.h Makefile + @echo "/* Autogenerated. Do not change. */" > _gnc-version.h + @echo "#ifndef GNC_VERSION_H" >> _gnc-version.h + @echo "#define GNC_VERSION_H" >> _gnc-version.h + @echo "" >> _gnc-version.h + @vcs_info=`${top_srcdir}/util/gnc-vcs-info -t ${top_srcdir}` ; \ if [ $$? = 0 ] ; then \ - echo "#define GNUCASH_SVN 1" >> _gnc-version.h ; \ + echo "#define GNUCASH_VCS \"$$vcs_info\"" >> _gnc-version.h ; \ fi @echo "#define GNUCASH_BUILD_DATE \"`date +%Y-%m-%d`\"" >> _gnc-version.h - @echo "#include \"gnc-svninfo.h\"" >> _gnc-version.h - @echo "#endif" >> _gnc-version.h + @echo "#include \"gnc-vcs-info.h\"" >> _gnc-version.h + @echo "#endif" >> _gnc-version.h -gnc-svninfo.h: _gnc-svninfo.h - -if [ ! -f gnc-svninfo.h ]; then cp _gnc-svninfo.h gnc-svninfo.h; fi - -cmp -s _gnc-svninfo.h gnc-svninfo.h || cp _gnc-svninfo.h gnc-svninfo.h - -rm -f _gnc-svninfo.h +gnc-vcs-info.h: _gnc-vcs-info.h + -if [ ! -f gnc-vcs-info.h ]; then cp _gnc-vcs-info.h gnc-vcs-info.h; fi + -cmp -s _gnc-vcs-info.h gnc-vcs-info.h || cp _gnc-vcs-info.h gnc-vcs-info.h + -rm -f _gnc-vcs-info.h -_gnc-svninfo.h: Makefile - @svninfo=`${top_srcdir}/util/gnc-svnversion ${top_srcdir}` ; \ +_gnc-vcs-info.h: Makefile + @vcs_info=`${top_srcdir}/util/gnc-vcs-info -r ${top_srcdir}` ; \ if [ $$? = 0 ] ; then \ - if [ -z "$$svninfo" ] ; then \ - echo "gnc-svnversion failed. figure out why." ; \ - echo "can't determine svn revision from ${top_srcdir}." ; \ + if [ -z "$$vcs_info" ] ; then \ + echo "gnc-vcs-info failed. figure out why." ; \ + echo "can't determine svn/svk/git/bzr revision from ${top_srcdir}." ; \ exit 1 ; \ fi ; \ - echo "/* Autogenerated. Do not change. */" > _gnc-svninfo.h ; \ - echo "#define GNUCASH_SVN_REV \"$$svninfo\"" >> _gnc-svninfo.h ; \ + echo "/* Autogenerated. Do not change. */" > _gnc-vcs-info.h ; \ + echo "#define GNUCASH_VCS_REV \"$$vcs_info\"" >> _gnc-vcs-info.h ; \ else \ - if [ -r $(srcdir)/gnc-svninfo.h ] ; then \ - cp $(srcdir)/gnc-svninfo.h _gnc-svninfo.h ; \ + if [ -r $(srcdir)/gnc-vcs-info.h ] ; then \ + cp $(srcdir)/gnc-vcs-info.h _gnc-vcs-info.h ; \ else \ - echo "You're building from SVN... But your build system is broken" ; \ + echo "You're building from svn/svk/git/bzr... But your build system is broken" ; \ echo "Don't do that. Complain to your build-system creator." ; \ exit 1 ; \ fi ; \ diff --git a/src/core-utils/gnc-main.h b/src/core-utils/gnc-main.h index b708f8a68c..7c7b59a385 100644 --- a/src/core-utils/gnc-main.h +++ b/src/core-utils/gnc-main.h @@ -42,6 +42,4 @@ const gchar *gnc_get_gconf_path(void); guint gnc_get_long_version( void ); -gint gnc_get_svn_version(void); - #endif /* GNC_MAIN_H */ diff --git a/src/doc/python-bindings-doxygen.py b/src/doc/python-bindings-doxygen.py index 4f27a1c515..6bbc225768 100644 --- a/src/doc/python-bindings-doxygen.py +++ b/src/doc/python-bindings-doxygen.py @@ -27,9 +27,6 @@ ## @page python_bindings_page Python bindings # Also have a look at group @ref python_bindings. # -# For the moment the python-bindings are only available via svn. They may be included -# in GnuCash 2.4. -# # They can be found in src/optional/python-bindings. # # To enable them in the compilation process you have to add --enable-python-bindings @@ -69,8 +66,8 @@ # @li gnucash_core_c.py # # If you have generated your own local doxygen documentation (by "make doc") after having compiled the python-bindings, doxygen -# will include SWIGs output-files. The official version at http://svn.gnucash.org/docs/HEAD/ does not include -# these files. It's actually quite interesting to have a look at them through doxygen, because they contain all that you can +# will include SWIGs output-files. +# It's actually quite interesting to have a look at them through doxygen, because they contain all that you can # access from python. # # This c-style-api is the bottom layer. It is a quite raw extract and close to the original source. Some more details are described further down. @@ -131,5 +128,5 @@ # @li There is a page in the GnuCash wiki at http://wiki.gnucash.org/wiki/Python # @li You may also have a look into the archives of gnucash-devel@gnucash.org. # @li On Bugzilla there is also some interesting talk regarding the development process. -# @li Then you can use the abilitys of svn to see the history of the code by @code svn log @endcode done in the directory of the python-bindings. +# @li Then you can use the abilities of svn to see the history of the code by @code svn log @endcode done in the directory of the python-bindings. # diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 3f55b14c2a..38d89e2515 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -188,7 +188,7 @@ endif noinst_DATA = .scm-links -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS # The generated file depends on various libqof headers. Out of # laziness I only include a few here - more might be needed diff --git a/src/gnc-module/Makefile.am b/src/gnc-module/Makefile.am index 82842669b3..b9d769352a 100644 --- a/src/gnc-module/Makefile.am +++ b/src/gnc-module/Makefile.am @@ -29,7 +29,7 @@ gncinclude_HEADERS = \ noinst_DATA = .scm-links -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-gnc-module.c: gnc-module.i ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< diff --git a/src/gnc-module/test/mod-bar/Makefile.am b/src/gnc-module/test/mod-bar/Makefile.am index 327614c5c1..f4d7084400 100644 --- a/src/gnc-module/test/mod-bar/Makefile.am +++ b/src/gnc-module/test/mod-bar/Makefile.am @@ -22,7 +22,7 @@ libgncmodbar_la_LIBADD=libbar.la \ $(GUILE_LIBS) \ $(GLIB_LIBS) -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-bar.c: bar.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module -o $@ $< endif diff --git a/src/gnc-module/test/mod-baz/Makefile.am b/src/gnc-module/test/mod-baz/Makefile.am index 6d63974455..20cf9baee8 100644 --- a/src/gnc-module/test/mod-baz/Makefile.am +++ b/src/gnc-module/test/mod-baz/Makefile.am @@ -26,7 +26,7 @@ libgncmodbaz_la_LIBADD = \ $(GUILE_LIBS) \ $(GLIB_LIBS) -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-baz.c: baz.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module -o $@ $< endif diff --git a/src/gnc-module/test/mod-foo/Makefile.am b/src/gnc-module/test/mod-foo/Makefile.am index f417f88531..4889329209 100644 --- a/src/gnc-module/test/mod-foo/Makefile.am +++ b/src/gnc-module/test/mod-foo/Makefile.am @@ -27,7 +27,7 @@ EXTRA_DIST = \ foo.i \ gnucash/foo.scm -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-foo.c: foo.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module -o $@ $< endif diff --git a/src/gnc/main.cpp b/src/gnc/main.cpp index 1bc683c3bd..6e547d664b 100644 --- a/src/gnc/main.cpp +++ b/src/gnc/main.cpp @@ -71,8 +71,8 @@ namespace gnc #define APP_GNUCASH "/apps/gnucash" -/* GNUCASH_SVN is defined whenever we're building from an SVN tree */ -#ifdef GNUCASH_SVN +/* GNUCASH_VCS is defined whenever we're building from an svn/svk/git/bzr tree */ +#ifdef GNUCASH_VCS static int is_development_version = TRUE; #else static int is_development_version = FALSE; diff --git a/src/gnome-utils/Makefile.am b/src/gnome-utils/Makefile.am index a7e788960a..a5cb4f98a2 100644 --- a/src/gnome-utils/Makefile.am +++ b/src/gnome-utils/Makefile.am @@ -212,7 +212,7 @@ if HAVE_X11_XLIB_H libgncmod_gnome_utils_la_LIBADD += -lX11 endif -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-gnome-utils.c: gnome-utils.i \ ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c index f53d521b86..e450ec926a 100644 --- a/src/gnome-utils/gnc-main-window.c +++ b/src/gnome-utils/gnc-main-window.c @@ -4122,13 +4122,21 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window) authors = get_file_strsplit("AUTHORS"); documenters = get_file_strsplit("DOCUMENTERS"); license = get_file("LICENSE"); -#ifdef GNUCASH_SVN +#ifdef GNUCASH_VCS /* Development version */ - message = g_strdup_printf(_("%s This copy was built from svn r%s on %s."), - fixed_message, GNUCASH_SVN_REV, GNUCASH_BUILD_DATE); + /* Translators: 1st %s is a fixed message, which is translated independently; + 2nd %s is the vcs type (svn/svk/git/bzr); + 3rd %s is the vcs revision number; + 4th %s is the build date */ + message = g_strdup_printf(_("%s\nThis copy was built from %s rev %s on %s."), + fixed_message, GNUCASH_VCS, GNUCASH_VCS_REV, + GNUCASH_BUILD_DATE); #else - message = g_strdup_printf(_("%s This copy was built from r%s on %s."), - fixed_message, GNUCASH_SVN_REV, GNUCASH_BUILD_DATE); + /* Translators: 1st %s is a fixed message, which is translated independently; + 2nd %s is the vcs (svn/svk/git/bzr) revision number; + 3rd %s is the build date */ + message = g_strdup_printf(_("%s\nThis copy was built from rev %s on %s."), + fixed_message, GNUCASH_VCS_REV, GNUCASH_BUILD_DATE); #endif gtk_show_about_dialog (GTK_WINDOW (window), diff --git a/src/gnome-utils/gnc-splash.c b/src/gnome-utils/gnc-splash.c index 11d2502a18..d912d7913d 100644 --- a/src/gnome-utils/gnc-splash.c +++ b/src/gnome-utils/gnc-splash.c @@ -85,14 +85,22 @@ gnc_show_splash_screen (void) frame = gtk_frame_new (NULL); vbox = gtk_vbox_new (FALSE, 3); hbox = gtk_hbox_new (FALSE, 3); -#ifdef GNUCASH_SVN +#ifdef GNUCASH_VCS /* Development version */ - ver_string = g_strdup_printf(_("Version: GnuCash-%s svn (r%s built %s)"), - VERSION, GNUCASH_SVN_REV, GNUCASH_BUILD_DATE); + /* Translators: 1st %s is the GnuCash version (eg 2.4.11); + 2nd %s is the vcs type (svn/svk/git/bzr); + 3rd %s is the vcs revision number; + 4th %s is the build date */ + ver_string = g_strdup_printf(_("Version: GnuCash-%s %s (rev %s built %s)"), + VERSION, GNUCASH_VCS, GNUCASH_VCS_REV, + GNUCASH_BUILD_DATE); #else /* Dist Tarball */ - ver_string = g_strdup_printf(_("Version: GnuCash-%s (r%s built %s)"), - VERSION, GNUCASH_SVN_REV, GNUCASH_BUILD_DATE); + /* Translators: 1st %s is the GnuCash version (eg 2.4.11); + 2nd %s is the vcs (svn/svk/git/bzr) revision number; + 3rd %s is the build date */ + ver_string = g_strdup_printf(_("Version: GnuCash-%s (rev %s built %s)"), + VERSION, GNUCASH_VCS_REV, GNUCASH_BUILD_DATE); #endif version = gtk_label_new(NULL); diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index 0ac74350f0..b84f19f6d4 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -98,7 +98,7 @@ noinst_HEADERS = \ window-reconcile.h \ window-autoclear.h -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-gnome.c: gnome.i dialog-progress.h ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< diff --git a/src/html/Makefile.am b/src/html/Makefile.am index b3d607e297..19e23ddfa8 100644 --- a/src/html/Makefile.am +++ b/src/html/Makefile.am @@ -61,7 +61,7 @@ libgncmod_html_la_LIBADD = \ ${GUILE_LIBS} \ ${REGEX_LIBS} -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-gnc-html.c: gnc-html.i gnc-html.h \ ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ diff --git a/src/optional/python-bindings/Makefile.am b/src/optional/python-bindings/Makefile.am index 7c066273c9..e54895a54f 100644 --- a/src/optional/python-bindings/Makefile.am +++ b/src/optional/python-bindings/Makefile.am @@ -37,7 +37,7 @@ _gnucash_core_c_la_LIBADD = \ ${top_builddir}/src/libqof/qof/libgnc-qof.la \ ${top_builddir}/src/gnc-module/libgnc-module.la \ ${top_builddir}/src/engine/libgncmod-engine.la -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS _gnucash_core_c_includes= \ ${top_builddir}/config.h \ ${top_srcdir}/src/libqof/qof/qofsession.h \ diff --git a/src/optional/python-bindings/gnucash_core.py b/src/optional/python-bindings/gnucash_core.py index 2237261ca3..8db25cf067 100644 --- a/src/optional/python-bindings/gnucash_core.py +++ b/src/optional/python-bindings/gnucash_core.py @@ -298,7 +298,7 @@ class GncPrice(GnuCashCoreClass): commodity with respect to another commodity. For example, a given price might represent the value of LNUX in USD on 2001-02-03. - See also http://svn.gnucash.org/docs/head/group__Price.html + See also http://code.gnucash.org/docs/head/group__Price.html ''' pass GncPrice.add_methods_with_prefix('gnc_price_') @@ -317,7 +317,7 @@ class GncPriceDB(GnuCashCoreClass): Every QofBook contains a GNCPriceDB, accessible via gnc_pricedb_get_db. Definition in file gnc-pricedb.h. - See also http://svn.gnucash.org/docs/head/gnc-pricedb_8h.html + See also http://code.gnucash.org/docs/head/gnc-pricedb_8h.html ''' GncPriceDB.add_methods_with_prefix('gnc_pricedb_') diff --git a/src/pixmaps/Makefile.am b/src/pixmaps/Makefile.am index dcebe330de..243f65c9e4 100644 --- a/src/pixmaps/Makefile.am +++ b/src/pixmaps/Makefile.am @@ -78,7 +78,7 @@ gncextrasmallicon_DATA = 16x16/gnucash-icon.png gncscalableicondir = ${datadir}/icons/hicolor/scalable/apps gncscalableicon_DATA = scalable/gnucash-icon.svg -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS 256x256/gnucash-icon.png: gnucash-icon-256x256.png -mkdir -p 256x256 cp ${srcdir}/gnucash-icon-256x256.png 256x256/gnucash-icon.png @@ -160,8 +160,8 @@ EXTRA_DIST = \ ${ico_files_lr} \ ${gncscalableicon_DATA} -# Only clean up if we're building from SVN -if BUILDING_FROM_SVN +# Only clean up if we're building from svn/svk/git/bzr +if BUILDING_FROM_VCS clean-local: -rm -rf 256x256 128x128 96x96 64x64 48x48 32x32 24x24 22x22 16x16 scalable endif diff --git a/src/report/report-gnome/Makefile.am b/src/report/report-gnome/Makefile.am index 0558bcdd2f..031f2381da 100644 --- a/src/report/report-gnome/Makefile.am +++ b/src/report/report-gnome/Makefile.am @@ -51,7 +51,7 @@ libgncmod_report_gnome_la_LIBADD = \ ${GCONF_LIBS} \ ${GLIB_LIBS} -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-report-gnome.c: report-gnome.i ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< diff --git a/src/report/report-system/Makefile.am b/src/report/report-system/Makefile.am index 373f2a20a8..069be31404 100644 --- a/src/report/report-system/Makefile.am +++ b/src/report/report-system/Makefile.am @@ -20,7 +20,7 @@ libgncmod_report_system_la_LIBADD = \ ${GLIB_LIBS} \ ${GTK_LIBS} -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-report-system.c: report-system.i ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< diff --git a/src/test-core/Makefile.am b/src/test-core/Makefile.am index b16cdb7fe3..b6e0dbe3fd 100644 --- a/src/test-core/Makefile.am +++ b/src/test-core/Makefile.am @@ -23,7 +23,7 @@ libtest_core_la_CPPFLAGS = \ libtest_core_la_LDFLAGS = \ -rpath ${exec-prefix}/lib -if BUILDING_FROM_SVN +if BUILDING_FROM_VCS swig-unittest-support-guile.c: unittest-support.i $(top_srcdir)/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src \ diff --git a/util/gnc-svnversion b/util/gnc-vcs-info similarity index 67% rename from util/gnc-svnversion rename to util/gnc-vcs-info index 19d73d8b40..7cb105fb64 100755 --- a/util/gnc-svnversion +++ b/util/gnc-vcs-info @@ -1,15 +1,24 @@ #!/bin/sh # # Usage: -# gnc-svnversion +# gnc-vcs-info -r +# gnc-vcs-info -t # -# Prints the revision number to stdout and exits 0 on success -# exits with errorcode 1 if we're not in an svn, svk or git checkout +# With -r prints the revision number to stdout and exits 0 on success +# With -t prints the vcs type that was detected to stdout and exits 0 +# on success. +# +# Exits with errorcode 1 if we're not in an bzr, svn, svk or git checkout # # Written By: Derek Atkins +# Updated By: Geert Janssens # # $Id$ +# Default string to return if not invoked properly +usage="Usage: $0 -r + $0 -t " + # Print an error message and then exit my_die() { @@ -29,24 +38,45 @@ if [ "$BUILDING_FROM_SVN" = "0" -o \ fi # Make sure we have a srcdir -[ -n "$1" ] || my_die "Usage: $0 " -[ -d "$1" ] || my_die "$0: $1: not a directory" +[ -n "$1" ] || my_die "$usage" +[ -n "$2" ] || my_die "$usage" +[ -d "$2" ] || my_die "$0: $2: not a directory" + + +if [ "$1" = "-t" ] +then + request="type" +elif [ "$1" = "-r" ] +then + request="revision" +else + my_die "$usage" +fi + +srcdir=$2 # 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 +if test -h "$srcdir"/Makefile.am then - tmp_srcdir=`readlink "$1"/Makefile.am` - real_srcdir="$1/`dirname ${tmp_srcdir}`" + tmp_srcdir=`readlink "$srcdir"/Makefile.am` + real_srcdir="$srcdir/`dirname ${tmp_srcdir}`" else - real_srcdir="$1" + real_srcdir="$srcdir" 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 + # If we're only interested in the vcs type, then we're done here + if [ "$request" = "type" ] + then + echo "svn" + exit 0 + fi + # svnversion without options returns the most recent revision in the repo # at the time of the last svn update/checkout even if that revision # didn't hold any changes in the current path. Not very useful as a @@ -67,6 +97,13 @@ fi real_gitdir="${real_srcdir}"/.git if test -d "${real_gitdir}" then + # If we're only interested in the vcs type, then we're done here + if [ "$request" = "type" ] + then + echo "git" + exit 0 + fi + # The windows build uses environment variable $GIT_CMD to invoke git (adding git # to the PATH in Windows results in a build failure). # So for platform independence, use GIT_CMD for all @@ -88,13 +125,20 @@ fi if test -d "${real_srcdir}"/.bzr ; then - bzrhead=`(cd "${real_srcdir}"; bzr version-info --custom --template='{revno}\n')` - if test $? = 0 ; then - echo "$bzrhead"; - exit 0 - else - exit 1 - fi + # If we're only interested in the vcs type, then we're done here + if [ "$request" = "type" ] + then + echo "bzr" + exit 0 + fi + + bzrhead=`(cd "${real_srcdir}"; bzr version-info --custom --template='{revno}\n')` + if test $? = 0 ; then + echo "$bzrhead"; + exit 0 + else + exit 1 + fi fi if test $OSTYPE -a $OSTYPE = "msys"; @@ -117,8 +161,15 @@ if test $? != 0 ; then exit 1 ; fi svkinfo=`echo n | $svk_cmd 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 +# If we got here, then $real_srcdir is an svk checkout. +# If we're only interested in the vcs type, then we're done here +if [ "$request" = "type" ] +then + echo "bzr" + exit 0 +fi + +# 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_cmd info "$real_srcdir" | grep Rev | head -5 | sed -e 's/^.* \([0-9:]*\)$/\1/'`