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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 21 13:48:58 EST 2012


Author: martinl
Date: 2012-02-21 10:48:58 -0800 (Tue, 21 Feb 2012)
New Revision: 50917

Modified:
   grass/branches/releasebranch_6_4/lib/init/init.bat
   grass/branches/releasebranch_6_4/lib/init/init.sh
Log:
update init.sh/bat (check for addon_path, wingisbase -> gisbase) - now sync'ed with devbr6

Modified: grass/branches/releasebranch_6_4/lib/init/init.bat
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/init.bat	2012-02-21 18:44:48 UTC (rev 50916)
+++ grass/branches/releasebranch_6_4/lib/init/init.bat	2012-02-21 18:48:58 UTC (rev 50917)
@@ -26,7 +26,7 @@
 rem DON'T include scripts directory in PATH - .bat files in bin directory
 rem are used to run scripts on Windows
 if "%GRASS_ADDON_PATH%"=="" set GRASS_ADDON_PATH=%APPDATA%\GRASS6\addons
-PATH=%WINGISBASE%\bin;%WINGISBASE%\lib;%GRASS_ADDON_PATH%;%PATH%
+PATH=%GISBASE%\bin;%GISBASE%\lib;%GRASS_ADDON_PATH%;%PATH%
 
 set GIS_LOCK=1
 set GRASS_VERSION=GRASS_VERSION_NUMBER
@@ -41,10 +41,10 @@
 set GISRC=junk
 
 rem Generate GISBASE by converting dirsep characters from \ to /
-FOR /F "usebackq delims==" %%i IN (`g.dirseps -g "%WINGISBASE%"`) DO @set GISBASE=%%i
+FOR /F "usebackq delims==" %%i IN (`g.dirseps -g "%GISBASE%"`) DO @set GISBASE=%%i
 
 if not "%LANG%"=="" goto langset
-FOR /F "usebackq delims==" %%i IN (`"%WINGISBASE%\etc\winlocale"`) DO @set LANG=%%i
+FOR /F "usebackq delims==" %%i IN (`"%GISBASE%\etc\winlocale"`) DO @set LANG=%%i
 :langset
 
 set GRASS_PAGER=more
@@ -80,9 +80,9 @@
 
 set HAVE_GISRC=false
 rem Create an initial GISRC file based on current directory
-"%WINGISBASE%\etc\echo" "GISDBASE: %USERPROFILE%" | g.dirseps -g > "%WINGISRC%"
-"%WINGISBASE%\etc\echo" "LOCATION_NAME: <UNKNOWN>" >> "%WINGISRC%"
-"%WINGISBASE%\etc\echo" "MAPSET: <UNKNOWN>" >> "%WINGISRC%"
+"%GISBASE%\etc\echo" "GISDBASE: %USERPROFILE%" | g.dirseps -g > "%WINGISRC%"
+"%GISBASE%\etc\echo" "LOCATION_NAME: <UNKNOWN>" >> "%WINGISRC%"
+"%GISBASE%\etc\echo" "MAPSET: <UNKNOWN>" >> "%WINGISRC%"
 
 :aftercreategisrc
 
@@ -102,7 +102,7 @@
 
 rem Clean out old .tmp files from the mapset
 if "%HAVE_GISRC%"=="true" (
-  "%WINGISBASE%\etc\clean_temp" > NUL:
+  "%GISBASE%\etc\clean_temp" > NUL:
 )
 set HAVE_GISRC=
 
@@ -110,9 +110,9 @@
 if "%GRASS_GUI%"=="wxpython" goto wxpython
 
 if not "%GRASS_WISH%"=="" (
-	"%GRASS_WISH%" "%WINGISBASE%\etc\gis_set.tcl"
+	"%GRASS_WISH%" "%GISBASE%\etc\gis_set.tcl"
 ) else (
-	"%WINGISBASE%\etc\gis_set.tcl"
+	"%GISBASE%\etc\gis_set.tcl"
 )
 
 rem This doesn't seem to work; don't understand return codes from gis_set.tcl PK
@@ -121,19 +121,19 @@
 
 rem Does line 42 above mean that GRASS_WISH will always be set?
 if not "%GRASS_WISH%"=="" (
-	start /b "GRASS Tcl/Tk" "%GRASS_WISH%" "%WINGISBASE%\etc\gm\gm.tcl"
+	start /b "GRASS Tcl/Tk" "%GRASS_WISH%" "%GISBASE%\etc\gm\gm.tcl"
 ) else (
-	start /b "GRASS Tcl/Tk" "%WINGISBASE%\etc\gm\gm.tcl"
+	start /b "GRASS Tcl/Tk" "%GISBASE%\etc\gm\gm.tcl"
 )
 
 rem Will redirecting output to NUL hide legitamite error messages, harming debugging?
-"%WINGISBASE%\etc\clean_temp" > NUL:
+"%GISBASE%\etc\clean_temp" > NUL:
 
 goto exitinit
 
 :wxpython
 
-set PYTHONPATH=%PYTHONPATH%;%WINGISBASE%\etc\python;%WINGISBASE%\etc\wxpython
+set PYTHONPATH=%PYTHONPATH%;%GISBASE%\etc\python;%GISBASE%\etc\wxpython
 
 python "%GISBASE%/etc/wxpython/gis_set.py"
 if %errorlevel% == 2 goto exitinit
@@ -143,22 +143,22 @@
 
 :text
 
-"%WINGISBASE%\etc\set_data"
+"%GISBASE%\etc\set_data"
 
 if %errorlevel% == 1 goto exitinit
 
 rem Get LOCATION_NAME to use in prompt
 FOR /F "usebackq delims==" %%i IN (`g.gisenv "get=LOCATION_NAME"`) DO @set LOCATION_NAME=%%i
 
-type "%WINGISBASE%\etc\welcome"
+type "%GISBASE%\etc\welcome"
 
-"%WINGISBASE%\etc\echo" ""
-"%WINGISBASE%\etc\echo" "GRASS homepage:                          http://grass.osgeo.org/"
-"%WINGISBASE%\etc\echo" "This version running thru:               Windows Command Shell (cmd.exe)"
-"%WINGISBASE%\etc\echo" "When ready to quit enter:                exit"
-"%WINGISBASE%\etc\echo" "Help is available with the command:      g.manual -i"
-"%WINGISBASE%\etc\echo" "See the licence terms with:              g.version -c"
-"%WINGISBASE%\etc\echo" ""
+"%GISBASE%\etc\echo" ""
+"%GISBASE%\etc\echo" "GRASS homepage:                          http://grass.osgeo.org/"
+"%GISBASE%\etc\echo" "This version running thru:               Windows Command Shell (cmd.exe)"
+"%GISBASE%\etc\echo" "When ready to quit enter:                exit"
+"%GISBASE%\etc\echo" "Help is available with the command:      g.manual -i"
+"%GISBASE%\etc\echo" "See the licence terms with:              g.version -c"
+"%GISBASE%\etc\echo" ""
 
 prompt GRASS %GRASS_VERSION% $C%LOCATION_NAME%$F$G 
 
@@ -169,7 +169,7 @@
 
 :displaylicence
 
-type "%WINGISBASE%\etc\license"
+type "%GISBASE%\etc\license"
 goto exitinit
 
 :settextmode
@@ -194,7 +194,7 @@
 :exitinit
 
 rem Clean out old .tmp files from the mapset
-"%WINGISBASE%\etc\clean_temp" > NUL:
+"%GISBASE%\etc\clean_temp" > NUL:
 
 set PATH=%SAVEPATH%
 set SAVEPATH=

Modified: grass/branches/releasebranch_6_4/lib/init/init.sh
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/init.sh	2012-02-21 18:44:48 UTC (rev 50916)
+++ grass/branches/releasebranch_6_4/lib/init/init.sh	2012-02-21 18:48:58 UTC (rev 50917)
@@ -14,7 +14,7 @@
 #   	    	command line options for setting the GISDBASE, LOCATION, and/or
 #   	    	MAPSET. Finally it starts GRASS with the appropriate user
 #   	    	interface and cleans up after it is finished.
-# COPYRIGHT:    (C) 2000-2011 by the GRASS Development Team
+# COPYRIGHT:    (C) 2000, 2010 by the GRASS Development Team
 #
 #               This program is free software under the GNU General Public
 #   	    	License (>=v2). Read the file COPYING that comes with GRASS
@@ -239,7 +239,7 @@
     fi
 else
     if [ "$GRASS_GUI" = "gui" ] ; then
-	GRASS_GUI="$DEFAULT_GUI"
+    	GRASS_GUI="$DEFAULT_GUI"
     elif [ "$GRASS_GUI" = "wx" ] ; then
 	GRASS_GUI="wxpython"
     fi
@@ -731,6 +731,15 @@
     exit 1
 fi
 
+# check gisenv's ADDON_PATH
+ADDON_PATH=`g.gisenv ADDON_PATH`
+if [ -n "$ADDON_PATH" ] ; then
+    GRASS_ADDON_PATH="$GRASS_ADDON_PATH:$ADDON_PATH"
+    export GRASS_ADDON_PATH
+    PATH="$GISBASE/bin:$GISBASE/scripts:$GRASS_ADDON_PATH:$PATH"
+    export PATH
+fi
+
 LOCATION="${GISDBASE?}/${LOCATION_NAME?}/${MAPSET?}"
 
 # Check for concurrent use
@@ -824,10 +833,10 @@
     
     # Check for tcltk interface
     tcltk | gis.m)
-       if [ "$sh" != "bash" ] && [ "$sh" != "msh" ] && [ "$sh" != "cygwin" ]; then
-               # trap is not supported by csh/tcsh and rc
-               "$GISBASE/scripts/gis.m"
-       fi;
+	if [ "$sh" != "bash" ] && [ "$sh" != "msh" ] && [ "$sh" != "cygwin" ]; then
+		# trap is not supported by csh/tcsh and rc
+		"$GISBASE/scripts/gis.m"
+	fi;
 	;;
     oldtcltk | d.m)
 	"$GISBASE/scripts/d.m"
@@ -978,7 +987,7 @@
     echo "export HOME=\"$USERHOME\"" >> "$bashrc" # restore user home path
     echo 'export GRASS_SHELL_PID=$$' >> "$bashrc" # can be used to terminate GRASS session from GUI
     if [ "$GRASS_GUI" = tcltk ] || [ "$GRASS_GUI" = gis.m ]; then
-       echo '$GISBASE/scripts/gis.m' >> "$bashrc" # Start gis.m
+    	echo '$GISBASE/scripts/gis.m' >> "$bashrc" # Start gis.m
     fi;
     echo 'trap "echo \"GUI issued an exit\"; exit" SIGQUIT' >> "$bashrc"
 
@@ -1032,11 +1041,11 @@
 
 # Attempt to close any open gis.m instances.
 if [ -n "$TCLTKGRASSBASE" ] && [ `ps -a | grep -c "$GRASS_WISH"` -ge 1 ] ; then
-       echo "Closing open gis.m sessions....."
-       echo 'foreach gwin [lsearch -all -inline [winfo interps] gm_tcl*] {
-               catch {send -async $gwin Gm::remoteExit $env(GIS_LOCK)}
-       }
-       exit' | "$GRASS_WISH" #>/dev/null 2>&1
+	echo "Closing open gis.m sessions....."
+	echo 'foreach gwin [lsearch -all -inline [winfo interps] gm_tcl*] {
+		catch {send -async $gwin Gm::remoteExit $env(GIS_LOCK)}
+	}
+	exit' | "$GRASS_WISH" #>/dev/null 2>&1
 fi
 
 echo "Cleaning up temporary files ..."



More information about the grass-commit mailing list