Make msys.bat try harder to find the shells / rxvt

Also, switch out SH with bash. We know we have it.

Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
This commit is contained in:
Marius Storm-Olsen 2007-08-09 21:54:32 +02:00
Родитель 9336f28822
Коммит 0daae08323
1 изменённых файлов: 28 добавлений и 11 удалений

Просмотреть файл

@ -16,10 +16,12 @@ rem ember value of GOTO: is used to know recursion has happened.
if "%1" == "GOTO:" goto %2
rem ember command.com only uses the first eight characters of the label.
set OS_VERSION="NT"
goto _WindowsNT
rem ember that we only execute here if we are in command.com.
:_Windows
set OS_VERSION="9x"
if "x%COMSPEC%" == "x" set COMSPEC=command.com
start %COMSPEC% /e:4096 /c %0 GOTO: _Resume %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
@ -37,16 +39,31 @@ if "%1" == "MSYS" set MSYSTEM=MSYS
if NOT "x%DISPLAY%" == "x" set DISPLAY=
if EXIST bin\nul cd bin
if EXIST sh.exe goto startsh
if EXIST rxvt.exe goto startrxvt
rem We here assume old behavior, to make sure that older platforms can still use
rem this batch file to start their MSys environment.
set BIN=""
if EXIST bin\nul set BIN="bin\"
if EXIST %BIN%bash.exe goto startbash
if EXIST %BIN%rxvt.exe goto startrxvt
echo Cannot find the rxvt.exe or sh.exe binary -- aborting.
rem If we're not on win9x type OSs, lets try a little better at finding bash/rxvt
if "win%OS_VERSION%"=="win9x" goto failed
set BIN="%~dp0bin\"
if EXIST %BIN%bash.exe goto startbash
if EXIST %BIN%rxvt.exe goto startrxvt
:failed
echo Cannot find the rxvt.exe or bash.exe binary -- aborting.
pause
exit 1
rem exit 1
rem we skip using exit 1 here, since it will close the console you were working on
rem which probably isn't what you wanted. If the bat file was run from a shortcut
rem the window will still close, like you would expect it to. Sorry, you cant test
rem for exit values anymore, but hey, you can just un-rem the line above then! :-)
goto EOF
rem If you don't want to use rxvt then rename the file rxvt.exe to something
rem else. Then sh.exe will be used instead.
rem else. Then bash.exe will be used instead.
:startrxvt
rem Setup the default colors for rxvt.
@ -59,11 +76,11 @@ if "%MSYSTEM%" == "MSYS" set FGCOLOR=%MSYSFGCOLOR%
if "%MSYSTEM%" == "MINGW32" set BGCOLOR=%MINGW32BGCOLOR%
if "%MSYSTEM%" == "MINGW32" set FGCOLOR=%MINGW32FGCOLOR%
start rxvt -backspacekey  -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/sh --login -i
start %BIN%rxvt -backspacekey  -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn Courier-12 -tn msys -geometry 80x25 -e /bin/bash --login -i
exit
:startsh
call sh --login -i
:startbash
call %BIN%bash --login -i
:EOF
@ -71,7 +88,7 @@ rem ChangeLog:
rem 2002.03.07 Earnie Boyd mailto:earnie@users.sf.net
rem * Move the @echo off to the top.
rem * Change the binmode setting to nobinmode.
rem * Remove the angle brackets around email address to workaround MS
rem * Remove the angle brackets around email address to workaround MS
rem buggy command processor.
rem
rem 2002.03.12 Earnie Boyd mailto:earnie@users.sf.net
@ -110,7 +127,7 @@ rem 2002.11.18 Earnie Boyd mailto:earnie@users.sf.net
rem * Add command.com detection and restart with a larger environment to
rem avoid errors on w9x.
rem Many thanks to Randy W. Sims mailto:RandyS@ThePierianSpring.org.
rem See Randy's response to "RE: [Mingw-msys] Installation on WindowsME"
rem See Randy's response to "RE: [Mingw-msys] Installation on WindowsME"
rem from 11/06/2002 in the archives of mingw-msys@lists.sf.net.
rem
rem 2002.11.19 Paul Garceau mailto:pgarceau@attbi.com