[GRASS-SVN] r55194 - grass/branches/develbranch_6/scripts/v.db.addtable
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 25 11:17:49 PST 2013
Author: hamish
Date: 2013-02-25 11:17:49 -0800 (Mon, 25 Feb 2013)
New Revision: 55194
Modified:
grass/branches/develbranch_6/scripts/v.db.addtable/v.db.addtable
Log:
better handle spaces in GISDBASE (#1683)
Modified: grass/branches/develbranch_6/scripts/v.db.addtable/v.db.addtable
===================================================================
--- grass/branches/develbranch_6/scripts/v.db.addtable/v.db.addtable 2013-02-25 17:18:27 UTC (rev 55193)
+++ grass/branches/develbranch_6/scripts/v.db.addtable/v.db.addtable 2013-02-25 19:17:49 UTC (rev 55194)
@@ -52,7 +52,7 @@
if [ -z "$GISBASE" ] ; then
echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
+ exit 1
fi
# save command line
@@ -79,10 +79,17 @@
export LC_NUMERIC
### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
+MAPSET=`g.gisenv get=MAPSET`
+LOCATION_NAME=`g.gisenv get=LOCATION_NAME`
+GISDBASE=`g.gisenv get=GISDBASE`
+# the following line simply complains if any of these vars are unset.
+# It could be removed, as `` will at least set to "", but is left
+# here for historical-instructive purposes
+: ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
+
LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
+
# does map exist in CURRENT mapset?
eval `g.findfile element=vector file="$GIS_OPT_MAP" mapset="$MAPSET"`
MAP_MAPSET=`echo "$GIS_OPT_MAP" | grep '@' | cut -f2 -d'@'`
More information about the grass-commit
mailing list