[GRASS-SVN] r57575 - in grass/branches/releasebranch_6_4/scripts: v.in.e00 v.in.geonames v.in.gns v.in.mapgen v.in.sites.all v.out.gpsbabel v.report

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 31 23:58:14 PDT 2013


Author: hamish
Date: 2013-08-31 23:58:14 -0700 (Sat, 31 Aug 2013)
New Revision: 57575

Modified:
   grass/branches/releasebranch_6_4/scripts/v.in.e00/v.in.e00
   grass/branches/releasebranch_6_4/scripts/v.in.geonames/v.in.geonames
   grass/branches/releasebranch_6_4/scripts/v.in.gns/v.in.gns
   grass/branches/releasebranch_6_4/scripts/v.in.mapgen/v.in.mapgen
   grass/branches/releasebranch_6_4/scripts/v.in.sites.all/v.in.sites.all
   grass/branches/releasebranch_6_4/scripts/v.out.gpsbabel/v.out.gpsbabel
   grass/branches/releasebranch_6_4/scripts/v.report/v.report
Log:
better handle spaces in GISDBASE (#1683), rm some unused vars (merge r55224,r55225,r55223,r55209,r55221,r55211,r50242 from devbr6)

Modified: grass/branches/releasebranch_6_4/scripts/v.in.e00/v.in.e00
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.in.e00/v.in.e00	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.in.e00/v.in.e00	2013-09-01 06:58:14 UTC (rev 57575)
@@ -65,8 +65,6 @@
     exec g.parser "$0" "$@"
 fi
 
-PROG=`basename "$0"`
-
 #### check if we have awk
 if [ ! -x "`which awk`" ] ; then
     g.message -e "awk required, please install awk or gawk first"
@@ -78,10 +76,6 @@
 LC_NUMERIC=C
 export LC_NUMERIC
 
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
-
 E00TMP=$$
 
 #### check for avcimport 

Modified: grass/branches/releasebranch_6_4/scripts/v.in.geonames/v.in.geonames
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.in.geonames/v.in.geonames	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.in.geonames/v.in.geonames	2013-09-01 06:58:14 UTC (rev 57575)
@@ -57,8 +57,6 @@
     exec g.parser "$0" "$@"
 fi
 
-PROG=`basename "$0"`
-
 #### check if we have awk
 if [ ! -x "`which awk`" ] ; then
     g.message -e "awk required, please install awk/gawk first"
@@ -70,11 +68,7 @@
 LC_NUMERIC=C
 export LC_NUMERIC
 
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
 
-
 if [ -n "$GIS_OPT_INPUT" ] ; then
     FILEORIG="$GIS_OPT_INPUT"
     if [ -n "$GIS_OPT_VECT" ] ; then
@@ -97,8 +91,8 @@
 #are we in LatLong location?
 g.proj -p | grep -i name | grep -i Lon  > /dev/null
 if [ $? -eq 1 ] ; then
-  g.message -e "This module only operates in LatLong/WGS84 locations"
-  exit 1
+    g.message -e "This module only operates in LatLong/WGS84 locations"
+    exit 1
 fi
 
 # input test
@@ -110,7 +104,7 @@
 # DBF doesn't support lengthy text fields
 driver=`db.connect -p | grep -i driver | cut -d':' -f2`
 if [ "$driver" = "dbf" ] ; then
-   g.message -w "Since DBF driver is used, the content of the 'alternatenames' column might be cut with respect to the original Geonames.org column content"
+    g.message -w "Since the DBF driver is used, the content of the 'alternatenames' column might be cut with respect to the original Geonames.org column content"
 fi
 
 

Modified: grass/branches/releasebranch_6_4/scripts/v.in.gns/v.in.gns
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.in.gns/v.in.gns	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.in.gns/v.in.gns	2013-09-01 06:58:14 UTC (rev 57575)
@@ -57,8 +57,6 @@
     exec g.parser "$0" "$@"
 fi
 
-PROG=`basename "$0"`
-
 #### check if we have awk
 if [ ! -x "`which awk`" ] ; then
     g.message -e "awk required, please install awk/gawk first"
@@ -70,11 +68,7 @@
 LC_NUMERIC=C
 export LC_NUMERIC
 
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
 
-
 if [ -n "$GIS_OPT_FILE" ] ; then
     FILEORIG="$GIS_OPT_FILE"
     if [ -n "$GIS_OPT_VECT" ] ; then

Modified: grass/branches/releasebranch_6_4/scripts/v.in.mapgen/v.in.mapgen
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.in.mapgen/v.in.mapgen	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.in.mapgen/v.in.mapgen	2013-09-01 06:58:14 UTC (rev 57575)
@@ -86,9 +86,6 @@
           END { for (i = last; i > 0; i--) { print line[i]; } }'
 }
 
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
 
 OPTS=""
 
@@ -188,9 +185,9 @@
 
     #### check success/failure
     if [ $? -eq 0 ] ; then
-	g.message message="\"$NAME@$MAPSET\" successfully created." 
+	g.message message="<$NAME> successfully created." 
     else
-	g.message -e "An error occured on creating \"$NAME\" in mapset \"$MAPSET\", please check"'!'
+	g.message -e "An error occured on creating <$NAME>, please check"'!'
     fi
 fi
 

Modified: grass/branches/releasebranch_6_4/scripts/v.in.sites.all/v.in.sites.all
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.in.sites.all/v.in.sites.all	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.in.sites.all/v.in.sites.all	2013-09-01 06:58:14 UTC (rev 57575)
@@ -32,10 +32,10 @@
     exec g.parser "$0" "$@"
 fi
 
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
 
+MAPSET=`g.gisenv get=MAPSET`
+
+
 CONVERTEDMAPS=0
 for i in `g.mlist type=sites mapset=.`
 do

Modified: grass/branches/releasebranch_6_4/scripts/v.out.gpsbabel/v.out.gpsbabel
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.out.gpsbabel/v.out.gpsbabel	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.out.gpsbabel/v.out.gpsbabel	2013-09-01 06:58:14 UTC (rev 57575)
@@ -120,12 +120,7 @@
 LC_NUMERIC=C
 export LC_NUMERIC
 
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
 
-PROG=`basename "$0"`
-
 #### check for gpsbabel 
 if [ ! -x "`which gpsbabel`" ] ; then
     g.message -e "The gpsbabel program was not found, please install it first.

Modified: grass/branches/releasebranch_6_4/scripts/v.report/v.report
===================================================================
--- grass/branches/releasebranch_6_4/scripts/v.report/v.report	2013-09-01 06:48:57 UTC (rev 57574)
+++ grass/branches/releasebranch_6_4/scripts/v.report/v.report	2013-09-01 06:58:14 UTC (rev 57575)
@@ -99,14 +99,14 @@
 LAYER="$GIS_OPT_LAYER"
 
 # does the input vector map exist?
-eval `g.findfile element=vector file=$GIS_OPT_MAP`
+eval `g.findfile element=vector file="$GIS_OPT_MAP"`
 if [ ! "$file" ] ; then
    g.message -e "Vector map '$MAP' not found in mapset search path."
    exit 1
 fi
 
 #test if the input vector has a table attached in the given layer
-v.info -c map=$MAP layer=$LAYER >/dev/null 2>&1
+v.info -c map="$MAP" layer="$LAYER" >/dev/null 2>&1
 if [ $? -eq 0 ] ; then
  TABLEEXISTS=1
 else
@@ -114,7 +114,7 @@
 fi
 
 #fetch column names
-if [ $TABLEEXISTS -eq 1 ] ; then
+if [ "$TABLEEXISTS" -eq 1 ] ; then
  COLNAMES="`v.info -c map=$MAP layer=$LAYER | grep -v '^Displaying column type' | cut -d '|' -f2 | tr '\n' '|'`" >/dev/null 2>&1
 else
  COLNAMES="cat|"
@@ -140,7 +140,7 @@
 
 ## NOTE: we suppress -1 cat and 0 cat
 
-if [ $TABLEEXISTS -eq 1 ] ; then
+if [ "$TABLEEXISTS" -eq 1 ] ; then
    v.db.select -c map="$MAP" layer="$LAYER" | sort -n -t'|' -k 1 | grep -v '^0' > "$TMP1"
    if [ `wc -l "$TMP1" | awk '{print $1}'` -eq 0 ] ; then
       KEY=`v.db.connect -gl map="$GIS_OPT_MAP" fs="|" layer="$LAYER" | cut -f3 -d'|'`



More information about the grass-commit mailing list