sbsv2/raptor/bin/sbs.bat
author Jon Chatten
Wed, 03 Mar 2010 10:03:19 +0000
branchfix
changeset 299 2257b1af191f
parent 276 e80c44f576df
child 380 db59fc762214
permissions -rwxr-xr-x
SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor] - revised.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     1
@rem
276
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
     2
@rem Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     3
@rem All rights reserved.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     4
@rem This component and the accompanying materials are made available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     5
@rem under the terms of the License "Eclipse Public License v1.0"
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     6
@rem which accompanies this distribution, and is available
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     7
@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     8
@rem
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
     9
@rem Initial Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    10
@rem Nokia Corporation - initial contribution.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    11
@rem
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    12
@rem Contributors:
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    13
@rem
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    14
@rem Description: 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    15
@rem
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    16
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    17
@SETLOCAL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    18
@SET HOSTPLATFORM=win 32
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    19
@SET HOSTPLATFORM_DIR=win32
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    20
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    21
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    22
@REM Automatically find SBS_HOME if it is not set
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    23
@IF NOT "%SBS_HOME%"==""  goto foundhome
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    24
@SET RAPTORBINDIR=%~dp0
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    25
@SET WD=%cd%
113
3d2908a2186b Release note: sf bug 1558: [Raptor] auto-setting of SBS_HOME by sbs.bat fails when drives differ
Jon Chatten
parents: 19
diff changeset
    26
@cd /d %RAPTORBINDIR%\..
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    27
@SET SBS_HOME=%cd%
113
3d2908a2186b Release note: sf bug 1558: [Raptor] auto-setting of SBS_HOME by sbs.bat fails when drives differ
Jon Chatten
parents: 19
diff changeset
    28
@cd /d %WD%
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    29
:foundhome 
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    30
276
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    31
@REM The python and PYTHONPATH used by Raptor are determined by, in order of precedence:
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    32
@REM 1. the SBS_PYTHON and SBS_PYTHONPATH environment variables (if set)
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    33
@REM 2. the python shipped locally with Raptor (if present)
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    34
@REM 3. the python on the system PATH and the PYTHONPATH set in the system environment
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    35
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    36
@SET __LOCAL_PYTHON__=%SBS_HOME%\win32\python264\python.exe
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    37
@IF NOT "%SBS_PYTHON%"=="" GOTO sbspython
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    38
@IF EXIST %__LOCAL_PYTHON__% GOTO localpython
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    39
@SET __PYTHON__=python.exe
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    40
@GOTO sbspythonpath
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    41
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    42
:sbspython
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    43
@SET __PYTHON__=%SBS_PYTHON%
276
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    44
@GOTO sbspythonpath
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    45
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    46
:localpython
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    47
@SET __PYTHON__=%__LOCAL_PYTHON__%
299
2257b1af191f SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor] - revised.
Jon Chatten
parents: 276
diff changeset
    48
@SET SBS_PYTHON=%__PYTHON__%
276
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    49
@SET PYTHONPATH=
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    50
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    51
:sbspythonpath
e80c44f576df release note: SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor]
Jon Chatten
parents: 231
diff changeset
    52
@IF NOT "%SBS_PYTHONPATH%"=="" SET PYTHONPATH=%SBS_PYTHONPATH%
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    53
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    54
@REM Use the mingw set by the environment if possible
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    55
@SET __MINGW__=%SBS_MINGW%
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    56
@IF "%__MINGW__%"=="" SET __MINGW__=%SBS_HOME%\win32\mingw
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    57
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    58
@REM Use the cygwin set by the environment if possible
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    59
@SET __CYGWIN__=%SBS_CYGWIN%
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    60
@IF "%__CYGWIN__%"=="" SET __CYGWIN__=%SBS_HOME%\win32\cygwin
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    61
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    62
@REM add to the search path
119
f293a5f26578 Prevern Path and PATH variables from messing things up
timothy.murphy@nokia.com
parents: 19
diff changeset
    63
@REM (make sure that we don't get into trouble if there are Path and PATH variables)
f293a5f26578 Prevern Path and PATH variables from messing things up
timothy.murphy@nokia.com
parents: 19
diff changeset
    64
@SET PATH_TEMP=%__MINGW__%\bin;%__CYGWIN__%\bin;%SBS_HOME%\win32\bin;%PATH%
f293a5f26578 Prevern Path and PATH variables from messing things up
timothy.murphy@nokia.com
parents: 19
diff changeset
    65
@SET PATH=
f293a5f26578 Prevern Path and PATH variables from messing things up
timothy.murphy@nokia.com
parents: 19
diff changeset
    66
@SET PATH=%PATH_TEMP%
f293a5f26578 Prevern Path and PATH variables from messing things up
timothy.murphy@nokia.com
parents: 19
diff changeset
    67
@SET PATH_TEMP=
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    68
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    69
@REM Make sure that /tmp is not set incorrectly for sbs
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    70
@umount -u /tmp >NUL  2>NUL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    71
@mount -u %TEMP% /tmp >NUL 2>NUL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    72
@umount -u / >NUL  2>NUL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    73
@mount -u %__CYGWIN__% / >NUL 2>NUL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    74
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    75
@REM Tell CYGWIN not to map unix security attributes to windows to
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    76
@REM prevent raptor from potentially creating read-only files:
299
2257b1af191f SF Bug 1912 - Raptor should take python from the path [if not set with SBS_PYTHON or bundled with Raptor] - revised.
Jon Chatten
parents: 276
diff changeset
    77
@SET CYGWIN=nontsec nosmbntsec
3
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    78
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    79
@REM Run Raptor with all the arguments.
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    80
@%__PYTHON__% %SBS_HOME%\python\raptor_start.py %*
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    81
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    82
@ENDLOCAL
e1eecf4d390d Team sf branch.
tnmurphy@4GBL06592.nokia.com
parents: 0
diff changeset
    83
@cmd /c exit /b %ERRORLEVEL%