[GRASS-SVN] r43617 - grass/branches/releasebranch_6_4/vector/v.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 22 09:59:34 EDT 2010


Author: neteler
Date: 2010-09-22 13:59:34 +0000 (Wed, 22 Sep 2010)
New Revision: 43617

Modified:
   grass/branches/releasebranch_6_4/vector/v.edit/Makefile
   grass/branches/releasebranch_6_4/vector/v.edit/main.c
Log:
backport: set up default DB if it doesn't exist

Modified: grass/branches/releasebranch_6_4/vector/v.edit/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.edit/Makefile	2010-09-22 13:58:44 UTC (rev 43616)
+++ grass/branches/releasebranch_6_4/vector/v.edit/Makefile	2010-09-22 13:59:34 UTC (rev 43617)
@@ -2,8 +2,8 @@
 
 PGM = v.edit
 
-LIBES = $(VEDITLIB) $(VECTLIB) $(GISLIB)
-DEPENDENCIES= $(VEDITDEP) $(VECTDEP) $(GISDEP)
+LIBES = $(VEDITLIB) $(VECTLIB) $(DBMILIB) $(GISLIB)
+DEPENDENCIES= $(VEDITDEP) $(VECTDEP) $(DBMIDEP) $(GISDEP)
 EXTRA_INC = $(VECT_INC)
 EXTRA_CFLAGS = $(VECT_CFLAGS)
 

Modified: grass/branches/releasebranch_6_4/vector/v.edit/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.edit/main.c	2010-09-22 13:58:44 UTC (rev 43616)
+++ grass/branches/releasebranch_6_4/vector/v.edit/main.c	2010-09-22 13:59:34 UTC (rev 43617)
@@ -1,4 +1,3 @@
-
 /****************************************************************
  *
  * MODULE:     v.edit
@@ -18,6 +17,7 @@
  * TODO:       3D support
  ****************************************************************/
 
+#include <grass/dbmi.h>
 #include "global.h"
 
 int main(int argc, char *argv[])
@@ -94,6 +94,11 @@
 			      params.map->answer);
 	}
 
+	if (! db_get_default_driver_name() ) {
+	    G_message(_("Creating new DB connection based on default mapset settings..."));
+	    db_set_default_connection();
+	}
+
 	/* 3D vector maps? */
 	ret = Vect_open_new(&Map, params.map->answer, WITHOUT_Z);
 	if (ret == -1) {



More information about the grass-commit mailing list