[GRASS-SVN] r55970 - grass/branches/releasebranch_6_4/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 24 01:16:37 PDT 2013


Author: hamish
Date: 2013-04-24 01:16:37 -0700 (Wed, 24 Apr 2013)
New Revision: 55970

Modified:
   grass/branches/releasebranch_6_4/lib/init/init.sh
Log:
bugfix:"C:\" was making it into the unix vesion of the $PATH, where : is the field sep., causing a bad path name and breakage of the addons (merge from devbr6)

Modified: grass/branches/releasebranch_6_4/lib/init/init.sh
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/init.sh	2013-04-24 08:15:16 UTC (rev 55969)
+++ grass/branches/releasebranch_6_4/lib/init/init.sh	2013-04-24 08:16:37 UTC (rev 55970)
@@ -252,6 +252,12 @@
     fi
 fi
 
+# in case of fire, break glass
+dos2unix_path()
+{
+   echo "$1" | sed -e 's|^\([A-Za-z]\):|/\1|' -e 's|\\|/|g'
+}
+
 # Set PATH to GRASS bin, ETC to GRASS etc
 ETC="$GISBASE/etc"
 
@@ -272,12 +278,13 @@
 # if it doesn't exist set it to something so that g.extension's default is reasonable
 if [ -z "$GRASS_ADDON_PATH" ] ; then
     if [ "$MINGW" ] ; then
-	GRASS_ADDON_PATH="$APPDATA/GRASS6/addons"
+	APPDATA_UNIX=`dos2unix_path "$APPDATA"`
+	GRASS_ADDON_PATH="$APPDATA_UNIX/GRASS6/addons"
     else
 	GRASS_ADDON_PATH="$HOME/.grass6/addons"
     fi
+    export GRASS_ADDON_PATH
 fi
-export GRASS_ADDON_PATH
 PATH="$GISBASE/bin:$GISBASE/scripts:$GRASS_ADDON_PATH:$PATH"
 export PATH
 



More information about the grass-commit mailing list