[GRASS-SVN] r52823 - grass/trunk/lib/vector/diglib

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 21 08:16:59 PDT 2012


Author: mmetz
Date: 2012-08-21 08:16:59 -0700 (Tue, 21 Aug 2012)
New Revision: 52823

Modified:
   grass/trunk/lib/vector/diglib/cindex_rw.c
   grass/trunk/lib/vector/diglib/plus_struct.c
   grass/trunk/lib/vector/diglib/spindex_rw.c
Log:
diglib: more understandable messages

Modified: grass/trunk/lib/vector/diglib/cindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/cindex_rw.c	2012-08-21 15:16:53 UTC (rev 52822)
+++ grass/trunk/lib/vector/diglib/cindex_rw.c	2012-08-21 15:16:59 UTC (rev 52823)
@@ -18,6 +18,8 @@
 #include <sys/types.h>
 #include <string.h>
 #include <grass/vector.h>
+#include <grass/glocale.h>
+#include <grass/version.h>
 
 int dig_write_cidx_head(struct gvfile * fp, struct Plus_head *plus)
 {
@@ -148,10 +150,12 @@
 	if (plus->cidx_Back_Major > GV_CIDX_VER_MAJOR ||
 	    plus->cidx_Back_Minor > GV_CIDX_VER_MINOR) {
 	    /* This version of GRASS lib is lower than the oldest which can read this format */
+	    G_debug(1, "Category index format version %d.%d",
+		    plus->cidx_Version_Major, plus->cidx_Version_Minor);
 	    G_fatal_error
-		("Category index format version %d.%d is not supported by this release."
-		 " Try to rebuild topology or upgrade GRASS.",
-		 plus->cidx_Version_Major, plus->cidx_Version_Minor);
+		(_("This version of GRASS (%d.%d) is too old to read this category index format."
+		 " Try to rebuild topology or upgrade GRASS to at least version %d."),
+		 GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GRASS_VERSION_MAJOR + 1);
 	    return (-1);
 	}
 

Modified: grass/trunk/lib/vector/diglib/plus_struct.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_struct.c	2012-08-21 15:16:53 UTC (rev 52822)
+++ grass/trunk/lib/vector/diglib/plus_struct.c	2012-08-21 15:16:59 UTC (rev 52823)
@@ -19,6 +19,7 @@
 #include <string.h>
 #include <grass/vector.h>
 #include <grass/glocale.h>
+#include <grass/version.h>
 /*
  * Routines for reading and writing Dig+ structures.
  * return 0 on success, -1 on failure of whatever kind
@@ -516,9 +517,12 @@
 	if (ptr->Back_Major > GV_TOPO_VER_MAJOR ||
 	    ptr->Back_Minor > GV_TOPO_VER_MINOR) {
 	    /* This version of GRASS lib is lower than the oldest which can read this format */
-	    G_fatal_error(_("Topology format version %d.%d is not supported by this release."
-			    " Try to rebuild topology or upgrade GRASS."),
-			  ptr->Version_Major, ptr->Version_Minor);
+	    G_debug(1, "Topology format version %d.%d",
+		    ptr->Version_Major, ptr->Version_Minor);
+	    G_fatal_error
+		(_("This version of GRASS (%d.%d) is too old to read this topology format."
+		 " Try to rebuild topology or upgrade GRASS to at least version %d."),
+		 GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GRASS_VERSION_MAJOR + 1);
 	    return (-1);
 	}
 

Modified: grass/trunk/lib/vector/diglib/spindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex_rw.c	2012-08-21 15:16:53 UTC (rev 52822)
+++ grass/trunk/lib/vector/diglib/spindex_rw.c	2012-08-21 15:16:59 UTC (rev 52823)
@@ -21,6 +21,7 @@
 #include <assert.h>
 #include <grass/vector.h>
 #include <grass/glocale.h>
+#include <grass/version.h>
 
 /* TODO: only write out actually used sides */
 #ifndef NUMSIDES
@@ -294,10 +295,12 @@
 	if (ptr->spidx_Back_Major > GV_SIDX_VER_MAJOR ||
 	    ptr->spidx_Back_Minor > GV_SIDX_VER_MINOR) {
 	    /* This version of GRASS lib is lower than the oldest which can read this format */
-	    G_fatal_error(_("Spatial index format version %d.%d is not "
-			    "supported by this release."
-			    " Try to rebuild topology or upgrade GRASS."),
-			  ptr->spidx_Version_Major, ptr->spidx_Version_Minor);
+	    G_debug(1, "Spatial index format version %d.%d",
+		    ptr->spidx_Version_Major, ptr->spidx_Version_Minor);
+	    G_fatal_error
+		(_("This version of GRASS (%d.%d) is too old to read this spatial index format."
+		 " Try to rebuild topology or upgrade GRASS to at least version %d."),
+		 GRASS_VERSION_MAJOR, GRASS_VERSION_MINOR, GRASS_VERSION_MAJOR + 1);
 	    return (-1);
 	}
 



More information about the grass-commit mailing list