[GRASS-SVN] r50622 - grass/branches/develbranch_6/scripts/v.db.join

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 1 20:48:56 EST 2012


Author: hamish
Date: 2012-02-01 17:48:56 -0800 (Wed, 01 Feb 2012)
New Revision: 50622

Modified:
   grass/branches/develbranch_6/scripts/v.db.join/v.db.join
Log:
sync flag description with code; rm debug msg; minor whitespace

Modified: grass/branches/develbranch_6/scripts/v.db.join/v.db.join
===================================================================
--- grass/branches/develbranch_6/scripts/v.db.join/v.db.join	2012-02-01 23:26:28 UTC (rev 50621)
+++ grass/branches/develbranch_6/scripts/v.db.join/v.db.join	2012-02-02 01:48:56 UTC (rev 50622)
@@ -25,8 +25,8 @@
 
 #%flag
 #% key: a
-#% label: Add suffix _o for the columns of otable
-#% description: Add suffix _o for the columns of otable; it is useful if you have columns with the same name in the two tables
+#% label: Add the suffix '_other' for the column names of otable
+#% description: This is useful if you have columns with the same name in both tables
 #%end
 
 #%option
@@ -80,7 +80,7 @@
 if [ "$1" != "@ARGS_PARSED@" ] ; then
     CMDLINE=`basename "$0"`
     for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
+	CMDLINE="$CMDLINE \"$arg\""
     done
     export CMDLINE
     exec g.parser "$0" "$@"
@@ -123,29 +123,26 @@
 COLTYPES=`db.describe -c driver="$driver" database="$database" table="$GIS_OPT_OTABLE" | grep '^Column ' | cut -d':' -f3 | tr -s ' ' '_'`
 
 i=1
-
-echo $GIS_FLAG_C;
-echo " $GIS_OPT_OCOLUMN";
-
 for col in $COLLIST ; do
     if [ "$GIS_FLAG_C" -eq 1 ] && [ "$col" = "$GIS_OPT_OCOLUMN" ] ; then
-        continue
+	continue
     elif [ "$GIS_FLAG_A" -eq 1 ] ; then
-        col="${col}_other"
+	col="${col}_other"
     fi
 
     v.db.addcol "$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" \
     col="$col `echo $COLTYPES | cut -d' ' -f$i | tr -s '_' ' '`"
 
     if [ $? -ne 0 ] ; then
-        g.message -e "Column creation failed. Cannot continue."
-        exit 1
+	g.message -e "Column creation failed. Cannot continue."
+	exit 1
     fi
 
     echo "UPDATE $maptable SET $col=(SELECT $col
-            FROM $GIS_OPT_OTABLE WHERE $GIS_OPT_OTABLE.$GIS_OPT_OCOLUMN=$maptable.$GIS_OPT_COLUMN);" | \
-    db.execute database="$database" driver="$driver"
-  i=`expr $i + 1`
+	    FROM $GIS_OPT_OTABLE WHERE $GIS_OPT_OTABLE.$GIS_OPT_OCOLUMN=$maptable.$GIS_OPT_COLUMN);" | \
+      db.execute database="$database" driver="$driver"
+
+    i=`expr $i + 1`
 done
 
 # write cmd history:



More information about the grass-commit mailing list