[GRASS-SVN] r30546 - grass/trunk/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 13 03:23:14 EDT 2008
Author: hamish
Date: 2008-03-13 03:23:14 -0400 (Thu, 13 Mar 2008)
New Revision: 30546
Modified:
grass/trunk/lib/init/init.sh
Log:
clean up auto-DB driver setting code (trac bug #7)
Modified: grass/trunk/lib/init/init.sh
===================================================================
--- grass/trunk/lib/init/init.sh 2008-03-13 07:02:47 UTC (rev 30545)
+++ grass/trunk/lib/init/init.sh 2008-03-13 07:23:14 UTC (rev 30546)
@@ -515,18 +515,14 @@
else
# the user wants to create mapset on the fly
if [ -n "$CREATE_NEW" ] && [ "$CREATE_NEW" -eq 1 ] ; then
- if [ ! -f "$GISDBASE/$LOCATION_NAME/PERMANENT/WIND" ] ; then
- echo "The LOCATION \"$LOCATION_NAME\" does not exist. Please create first"
+ if [ ! -f "$GISDBASE/$LOCATION_NAME/PERMANENT/DEFAULT_WIND" ] ; then
+ echo "The LOCATION \"$LOCATION_NAME\" does not exist. Please create it first"
cleanup_tmp
exit 1
else
mkdir -p "$LOCATION"
- cp "$GISDBASE/$LOCATION_NAME/PERMANENT/WIND" "$LOCATION/WIND"
+ cp "$GISDBASE/$LOCATION_NAME/PERMANENT/DEFAULT_WIND" "$LOCATION/WIND"
echo "Missing WIND file fixed"
- # predefine DBF driver to avoid v.* module breakage
- echo "DB_DRIVER: dbf" > "$LOCATION/VAR"
- echo "DB_DATABASE: \$GISDBASE/\$LOCATION_NAME/\$MAPSET/dbf/" >> "$LOCATION/VAR"
- mkdir "$LOCATION"/dbf
fi
else
echo "$LOCATION: Not a valid GRASS location"
@@ -728,13 +724,11 @@
g.mkfontcap
fi
-# predefine DBF driver if DB connection not defined
-# why is this needed ??
-# if [ ! -e "$LOCATION/VAR" ] ; then
-# echo "DB_DRIVER: dbf" > "$LOCATION/VAR"
-# echo "DB_DATABASE: \$GISDBASE/\$LOCATION_NAME/\$MAPSET/dbf/" >> "$LOCATION/VAR"
-# mkdir "$LOCATION"/dbf
-# fi
+# predefine default driver if DB connection not defined
+# is this really needed?? Modules should call this when/if required.
+if [ ! -e "$LOCATION/VAR" ] ; then
+ db.connect -c --quiet
+fi
trap "" 2 3 15
More information about the grass-commit
mailing list