[GRASS-SVN] r30439 - grass/trunk/scripts/v.db.dropcol

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 3 06:41:49 EST 2008


Author: msieczka
Date: 2008-03-03 06:41:49 -0500 (Mon, 03 Mar 2008)
New Revision: 30439

Modified:
   grass/trunk/scripts/v.db.dropcol/v.db.dropcol
Log:
Single-quote if possible.
Messages standarization.

Modified: grass/trunk/scripts/v.db.dropcol/v.db.dropcol
===================================================================
--- grass/trunk/scripts/v.db.dropcol/v.db.dropcol	2008-03-03 11:41:20 UTC (rev 30438)
+++ grass/trunk/scripts/v.db.dropcol/v.db.dropcol	2008-03-03 11:41:49 UTC (rev 30439)
@@ -48,7 +48,7 @@
 
 
 if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
+    echo 'You must be in GRASS GIS to run this program.' >&2
  exit 1
 fi
 
@@ -67,7 +67,7 @@
 #### setup temporary file
 TMP="`g.tempfile pid=$$`"
 if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files."
+    g.message -e 'Unable to create temporary files.'
     exit 1
 fi
 
@@ -79,7 +79,7 @@
 # what to do in case of user break:
 exitprocedure()
 {
- g.message -e "User break!"
+ g.message -e 'User break!'
  cleanup
  exit 1
 }
@@ -93,19 +93,19 @@
 # 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."
+   g.message -e "Vector map <$GIS_OPT_MAP> not found in current mapset."
    exit 1
 fi
 
 table=`v.db.connect $GIS_OPT_MAP -g | grep -w $GIS_OPT_LAYER | cut -f2 -d" "`
 if [ -z "$table" ] ; then
-   g.message -e "There is no table connected to this map! Cannot delete any column."
+   g.message -e 'There is no table connected to the input vector map! Cannot delete any column.'
    cleanup
    exit 1
 fi
-keycol=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f3 -d" "`
-database=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f4 -d" "`
-driver=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f5 -d" "`
+keycol=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f3 -d' '`
+database=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f4 -d' '`
+driver=`v.db.connect -g map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f5 -d' '`
 col="$GIS_OPT_COLUMN"
 
 if [ "$col" = "$keycol" ] ; then
@@ -141,14 +141,14 @@
 COMMIT;" > $TMP
 	db.execute input=$TMP
 	if [ $? -eq 1 ] ; then
-	    	g.message -e "Cannot continue (problem deleting column)."
+	    	g.message -e 'Cannot continue (problem deleting column).'
 	    	cleanup
 	    	exit 1
 	fi
 else
 	echo "ALTER TABLE $table DROP COLUMN $col" | db.execute database=$database driver=$driver
 	if [ $? -eq 1 ] ; then
-	    	g.message -e "Cannot continue (problem deleting column)."
+	    	g.message -e 'Cannot continue (problem deleting column).'
 	    	cleanup
 	    	exit 1
 	fi
@@ -161,4 +161,3 @@
 v.support ${GIS_OPT_MAP} cmdhist="${CMDLINE}"
 
 exit 0
-



More information about the grass-commit mailing list