[GRASS-SVN] r30160 - grass/trunk/scripts/v.db.addtable

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 14 16:24:42 EST 2008


Author: hamish
Date: 2008-02-14 16:24:42 -0500 (Thu, 14 Feb 2008)
New Revision: 30160

Modified:
   grass/trunk/scripts/v.db.addtable/v.db.addtable
Log:
map in mapset, try2; debork reversion

Modified: grass/trunk/scripts/v.db.addtable/v.db.addtable
===================================================================
--- grass/trunk/scripts/v.db.addtable/v.db.addtable	2008-02-14 21:04:55 UTC (rev 30159)
+++ grass/trunk/scripts/v.db.addtable/v.db.addtable	2008-02-14 21:24:42 UTC (rev 30160)
@@ -83,12 +83,19 @@
 LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
 
 # does map exist in CURRENT mapset?
-eval `g.findfile element=vector file=$GIS_OPT_MAP mapset=$MAPSET`
-if [ ! "$file" ] ; then
-   g.message -e  "Vector map '$GIS_OPT_MAP' not found in current mapset"
+eval `g.findfile element=vector file="$GIS_OPT_MAP" mapset="$MAPSET"`
+MAP_MAPSET=`echo "$GIS_OPT_MAP" | grep '@' | cut -f2 -d'@'`
+if [ -z "$MAP_MAPSET" ] ; then
+   MAP_MAPSET="$MAPSET"
+fi
+if [ ! "$file" ] || [ "$MAP_MAPSET" != "$MAPSET" ] ; then
+   g.message -e  "Vector map <$GIS_OPT_MAP> not found in current mapset"
    exit 1
+else
+   MAP_NAME=`echo "$GIS_OPT_MAP" | cut -f1 -d'@'` 
 fi
 
+
 if [ -z "$GIS_OPT_TABLE" ] ; then
     if [ $GIS_OPT_LAYER -eq 1 ] ; then
        g.message "Using vector map name as table name: $MAP_NAME" 



More information about the grass-commit mailing list