[GRASS-SVN] r55954 - grass/branches/develbranch_6/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 23 05:32:07 PDT 2013


Author: hamish
Date: 2013-04-23 05:32:07 -0700 (Tue, 23 Apr 2013)
New Revision: 55954

Modified:
   grass/branches/develbranch_6/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

Modified: grass/branches/develbranch_6/lib/init/init.sh
===================================================================
--- grass/branches/develbranch_6/lib/init/init.sh	2013-04-23 10:46:47 UTC (rev 55953)
+++ grass/branches/develbranch_6/lib/init/init.sh	2013-04-23 12:32:07 UTC (rev 55954)
@@ -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"
 
@@ -266,12 +272,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