sbsv2/raptor/bin/sbs.bat
branchfix
changeset 276 e80c44f576df
parent 231 0f26bc078e36
child 299 2257b1af191f
child 342 f0e42ff3359f
--- a/sbsv2/raptor/bin/sbs.bat	Fri Feb 26 14:41:19 2010 +0000
+++ b/sbsv2/raptor/bin/sbs.bat	Fri Feb 26 14:51:57 2010 +0000
@@ -1,5 +1,5 @@
 @rem
-@rem Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 @rem All rights reserved.
 @rem This component and the accompanying materials are made available
 @rem under the terms of the License "Eclipse Public License v1.0"
@@ -28,11 +28,27 @@
 @cd /d %WD%
 :foundhome 
 
-@REM Use the python set by the environment if possible
+@REM The python and PYTHONPATH used by Raptor are determined by, in order of precedence:
+@REM 1. the SBS_PYTHON and SBS_PYTHONPATH environment variables (if set)
+@REM 2. the python shipped locally with Raptor (if present)
+@REM 3. the python on the system PATH and the PYTHONPATH set in the system environment
+
+@SET __LOCAL_PYTHON__=%SBS_HOME%\win32\python264\python.exe
+@IF NOT "%SBS_PYTHON%"=="" GOTO sbspython
+@IF EXIST %__LOCAL_PYTHON__% GOTO localpython
+@SET __PYTHON__=python.exe
+@GOTO sbspythonpath
+
+:sbspython
 @SET __PYTHON__=%SBS_PYTHON%
-@IF "%__PYTHON__%"=="" SET __PYTHON__=%SBS_HOME%\win32\python264\python.exe
-@SET PYTHONPATH=%SBS_PYTHONPATH%
-@IF "%PYTHONPATH%"=="" SET PYTHONPATH=%SBS_HOME%\win32\python264
+@GOTO sbspythonpath
+
+:localpython
+@SET __PYTHON__=%__LOCAL_PYTHON__%
+@SET PYTHONPATH=
+
+:sbspythonpath
+@IF NOT "%SBS_PYTHONPATH%"=="" SET PYTHONPATH=%SBS_PYTHONPATH%
 
 @REM Use the mingw set by the environment if possible
 @SET __MINGW__=%SBS_MINGW%