[GRASS-SVN] r30007 - grass/trunk/scripts/v.db.renamecol
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 7 16:14:34 EST 2008
Author: neteler
Date: 2008-02-07 16:14:33 -0500 (Thu, 07 Feb 2008)
New Revision: 30007
Modified:
grass/trunk/scripts/v.db.renamecol/v.db.renamecol
Log:
fail if DBF driver and too long target column name
Modified: grass/trunk/scripts/v.db.renamecol/v.db.renamecol
===================================================================
--- grass/trunk/scripts/v.db.renamecol/v.db.renamecol 2008-02-07 20:30:14 UTC (rev 30006)
+++ grass/trunk/scripts/v.db.renamecol/v.db.renamecol 2008-02-07 21:14:33 UTC (rev 30007)
@@ -124,6 +124,16 @@
oldcol="`echo $GIS_OPT_COLUMN | cut -d',' -f1`"
newcol="`echo $GIS_OPT_COLUMN | cut -d',' -f2`"
+if [ "$driver" = "dbf" ] ; then
+ # strangely "" counts as 1
+ NAMELEN=`echo "$newcol" | wc -c | awk '{print $1}'`
+ if [ "$NAMELEN" -gt 11 ] ; then
+ g.message -e "Column name too long <$newcol>: the DBF driver only supports up to 10 characters as column name."
+ cleanup
+ exit 1
+ fi
+fi
+
if [ "$col" = "cat" ] ; then
g.message -e "Cannot rename <$col> column as it is needed to keep table \
connected to vector map"
More information about the grass-commit
mailing list