[GRASS-SVN] r30312 - grass-addons/vector/v.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 23 19:34:58 EST 2008


Author: hamish
Date: 2008-02-23 19:34:58 -0500 (Sat, 23 Feb 2008)
New Revision: 30312

Modified:
   grass-addons/vector/v.colors/v.colors
Log:
SQL columns names are case-insensitive

Modified: grass-addons/vector/v.colors/v.colors
===================================================================
--- grass-addons/vector/v.colors/v.colors	2008-02-23 20:06:53 UTC (rev 30311)
+++ grass-addons/vector/v.colors/v.colors	2008-02-24 00:34:58 UTC (rev 30312)
@@ -192,7 +192,7 @@
 
 #### column checks
 # check input data column 
-NCOLUMN_TYPE=`v.info -c map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | grep "|$GIS_OPT_COLUMN$" | cut -f1 -d'|'`
+NCOLUMN_TYPE=`v.info -c map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | grep -i "|$GIS_OPT_COLUMN$" | cut -f1 -d'|'`
 if [ -z "$NCOLUMN_TYPE" ] ; then
     echo "ERROR: Column <$GIS_OPT_COLUMN> not found"
     exit 1
@@ -204,7 +204,7 @@
 
 # check if GRASSRGB column exists, make it if it doesn't
 TABLE=`v.db.connect -g map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | cut -f2 -d' '`
-COLUMN_TYPE=`v.info -c map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | grep "|$GIS_OPT_RGB_COLUMN$" | cut -f1 -d'|'`
+COLUMN_TYPE=`v.info -c map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | grep -i "|$GIS_OPT_RGB_COLUMN$" | cut -f1 -d'|'`
 if [ -z "$COLUMN_TYPE" ] ; then
     # RGB Column not found, create it
     echo "Creating column <$GIS_OPT_RGB_COLUMN> ..."
@@ -217,7 +217,7 @@
     echo "ERROR: Column <$GIS_OPT_RGB_COLUMN> is not of compatible type"
     exit 1
 else
-    NUM_CHARS=`db.describe -c "$TABLE" | grep " $GIS_OPT_RGB_COLUMN:" | cut -f4 -d':'`
+    NUM_CHARS=`db.describe -c "$TABLE" | grep -i " $GIS_OPT_RGB_COLUMN:" | cut -f4 -d':'`
     if [ "$NUM_CHARS" -lt 11 ] ; then
        echo "ERROR: Color column <$GIS_OPT_RGB_COLUMN> is not wide enough (needs 11 characters)"
        exit 1



More information about the grass-commit mailing list