From 34b47d2a0b066c041ea07fe66b7bea94e6255000 Mon Sep 17 00:00:00 2001 From: michelou Date: Wed, 26 Apr 2006 15:58:56 +0000 Subject: added subroutine 'set_home' in batch commands --- .../scala/tools/ant/templates/generic-windows.tmpl | 15 ++++++++++----- src/compiler/scala/tools/ant/templates/tool-windows.tmpl | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/compiler/scala/tools/ant/templates/generic-windows.tmpl b/src/compiler/scala/tools/ant/templates/generic-windows.tmpl index a23422a7e4..5635d9a3ee 100644 --- a/src/compiler/scala/tools/ant/templates/generic-windows.tmpl +++ b/src/compiler/scala/tools/ant/templates/generic-windows.tmpl @@ -14,11 +14,7 @@ rem - Local batch variables start with an underscore ('_') if "%OS%"=="Windows_NT" ( @@setlocal - set _BIN_DIR= - for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi - set _SCALA_HOME=%_BIN_DIR%.. - rem The following works on WinXP SP2 or newer (http://support.microsoft.com/?kbid=833431) - rem set _SCALA_HOME=%~dsp0.. + call :set_home ) else ( set _SCALA_HOME=%SCALA_HOME% if "%_SCALA_HOME%"=="" goto error1 @@ -94,6 +90,15 @@ rem # subroutines ) goto :eof +rem Variable "%~dps0" works on WinXP SP2 or newer +rem (see http://support.microsoft.com/?kbid=833431) +rem set _SCALA_HOME=%~dps0.. +:set_home + set _BIN_DIR= + for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi + set _SCALA_HOME=%_BIN_DIR%.. +goto :eof + rem ########################################################################## rem # errors diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl index 8fcafb50a2..4a15430d50 100644 --- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl @@ -14,11 +14,7 @@ rem - Local batch variables start with an underscore ('_') if "%OS%"=="Windows_NT" ( @@setlocal - set _BIN_DIR= - for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi - set _SCALA_HOME=%_BIN_DIR%.. - rem The following works on WinXP SP2 or newer (http://support.microsoft.com/?kbid=833431) - rem set _SCALA_HOME=%~dsp0.. + call :set_home ) else ( set _SCALA_HOME=%SCALA_HOME% if "%_SCALA_HOME%"=="" goto error1 @@ -73,6 +69,15 @@ rem # subroutines ) goto :eof +rem Variable "%~dps0" works on WinXP SP2 or newer +rem (see http://support.microsoft.com/?kbid=833431) +rem set _SCALA_HOME=%~dps0.. +:set_home + set _BIN_DIR= + for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi + set _SCALA_HOME=%_BIN_DIR%.. +goto :eof + rem ########################################################################## rem # errors -- cgit v1.2.3