r20202 - gnucash/trunk - Add gnc_get_long_version, a guint concocted by adding the version values together allowing two digits for each. Add a new version value, GNUNCASH_NANO_VERSION, to be incremented when there's any change to data serialization. Use the new gnc_get_long_version to tag the Gnucash version in the versions table in the dbi backend.

John Ralls jralls at code.gnucash.org
Sat Jan 29 18:38:10 EST 2011


Author: jralls
Date: 2011-01-29 18:38:10 -0500 (Sat, 29 Jan 2011)
New Revision: 20202
Trac: http://svn.gnucash.org/trac/changeset/20202

Modified:
   gnucash/trunk/configure.ac
   gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c
   gnucash/trunk/src/backend/sql/gnc-backend-sql.c
   gnucash/trunk/src/core-utils/gnc-main.c
   gnucash/trunk/src/core-utils/gnc-main.h
Log:
Add gnc_get_long_version, a guint concocted by adding the version values together allowing two digits for each. Add a new version value, GNUNCASH_NANO_VERSION, to be incremented when there's any change to data serialization. Use the new gnc_get_long_version to tag the Gnucash version in the versions table in the dbi backend.

Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac	2011-01-29 23:16:00 UTC (rev 20201)
+++ gnucash/trunk/configure.ac	2011-01-29 23:38:10 UTC (rev 20202)
@@ -24,6 +24,10 @@
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_SRCDIR(src/engine/Transaction.h)
 
+#Change this in development versions when changing anything that
+#affects stored data structures. Reset to zero when bumping version.
+GNUCASH_NANO_VERSION=0
+
 # Initialize automake -- make sure we have at least version 1.9
 AM_INIT_AUTOMAKE([1.9 dist-bzip2])
 
@@ -67,6 +71,7 @@
 AC_SUBST(GNUCASH_MAJOR_VERSION)
 AC_SUBST(GNUCASH_MINOR_VERSION)
 AC_SUBST(GNUCASH_MICRO_VERSION)
+AC_SUBST(GNUCASH_NANO_VERSION)
 AC_SUBST(GNUCASH_LATEST_STABLE_SERIES)
 
 AC_DEFINE_UNQUOTED(GNUCASH_MAJOR_VERSION, $GNUCASH_MAJOR_VERSION,
@@ -75,6 +80,8 @@
     [GnuCash Minor version number])
 AC_DEFINE_UNQUOTED(GNUCASH_MICRO_VERSION, $GNUCASH_MICRO_VERSION,
     [GnuCash Micro version number])
+AC_DEFINE_UNQUOTED(GNUCASH_NANO_VERSION, $GNUCASH_NANO_VERSION,
+    [GnuCash Nano version number])
 AC_DEFINE_UNQUOTED(GNUCASH_LATEST_STABLE_SERIES, "$GNUCASH_LATEST_STABLE_SERIES",
     [Most recent stable GnuCash series])
 

Modified: gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c
===================================================================
--- gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c	2011-01-29 23:16:00 UTC (rev 20201)
+++ gnucash/trunk/src/backend/dbi/test/test-dbi-stuff.c	2011-01-29 23:38:10 UTC (rev 20202)
@@ -285,7 +285,7 @@
     QofBook *book;
     QofBackend *qbe;
     QofBackendError err;
-    gint ourversion = gnc_get_svn_version();
+    gint ourversion = gnc_get_long_version();
 
     printf( "Testing safe save %s\n", driver );
 

Modified: gnucash/trunk/src/backend/sql/gnc-backend-sql.c
===================================================================
--- gnucash/trunk/src/backend/sql/gnc-backend-sql.c	2011-01-29 23:16:00 UTC (rev 20201)
+++ gnucash/trunk/src/backend/sql/gnc-backend-sql.c	2011-01-29 23:38:10 UTC (rev 20202)
@@ -494,7 +494,7 @@
     ENTER( "book=%p, primary=%p", book, be->primary_book );
     update_progress( be );
     (void)reset_version_info( be );
-    gnc_sql_set_table_version( be, "Gnucash", gnc_get_svn_version() );
+    gnc_sql_set_table_version( be, "Gnucash", gnc_get_long_version() );
     gnc_sql_set_table_version( be, "Gnucash-Resave", GNC_RESAVE_VERSION );
 
     /* Create new tables */
@@ -609,7 +609,7 @@
     gboolean is_dirty;
     gboolean is_destroying;
     gboolean is_infant;
-    const gint gnc_version = gnc_get_svn_version();
+    const gint gnc_version = gnc_get_long_version();
 
     g_return_if_fail( be != NULL );
     g_return_if_fail( inst != NULL );

Modified: gnucash/trunk/src/core-utils/gnc-main.c
===================================================================
--- gnucash/trunk/src/core-utils/gnc-main.c	2011-01-29 23:16:00 UTC (rev 20201)
+++ gnucash/trunk/src/core-utils/gnc-main.c	2011-01-29 23:38:10 UTC (rev 20202)
@@ -88,3 +88,12 @@
 {
     return strtol(GNUCASH_SVN_REV, NULL, 10);
 }
+
+guint
+gnc_get_long_version()
+{
+return GNUCASH_MAJOR_VERSION * 1000000 +
+    GNUCASH_MINOR_VERSION * 10000 +
+    GNUCASH_MICRO_VERSION * 100 +
+    GNUCASH_NANO_VERSION;
+}

Modified: gnucash/trunk/src/core-utils/gnc-main.h
===================================================================
--- gnucash/trunk/src/core-utils/gnc-main.h	2011-01-29 23:16:00 UTC (rev 20201)
+++ gnucash/trunk/src/core-utils/gnc-main.h	2011-01-29 23:38:10 UTC (rev 20202)
@@ -40,6 +40,8 @@
 void gnc_set_gconf_path(const gchar *prefix);
 const gchar *gnc_get_gconf_path(void);
 
+guint gnc_get_long_version( void );
+
 gint gnc_get_svn_version(void);
 
 #endif /* GNC_MAIN_H */



More information about the gnucash-changes mailing list