sbsv2/raptor/bin/sbs.bat
changeset 308 7830b8253b5a
parent 299 2257b1af191f
child 380 db59fc762214
--- a/sbsv2/raptor/bin/sbs.bat	Fri Mar 05 14:30:49 2010 +0000
+++ b/sbsv2/raptor/bin/sbs.bat	Fri Mar 05 14:34:56 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,9 +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__=python.exe
+@GOTO sbspythonpath
+
+:localpython
+@SET __PYTHON__=%__LOCAL_PYTHON__%
+@SET SBS_PYTHON=%__PYTHON__%
+@SET PYTHONPATH=
+
+:sbspythonpath
 @IF NOT "%SBS_PYTHONPATH%"=="" SET PYTHONPATH=%SBS_PYTHONPATH%
 
 @REM Use the mingw set by the environment if possible
@@ -56,7 +74,7 @@
 
 @REM Tell CYGWIN not to map unix security attributes to windows to
 @REM prevent raptor from potentially creating read-only files:
-@set CYGWIN=nontsec nosmbntsec
+@SET CYGWIN=nontsec nosmbntsec
 
 @REM Run Raptor with all the arguments.
 @%__PYTHON__% %SBS_HOME%\python\raptor_start.py %*