Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6c534fd

Browse files
committed
Turn install.bat into a pure one line wrapper fort he perl script.
Build.bat and vcregress.bat got similar treatment years ago. I'm not sure why install.bat wasn't treated at the same time, but it seems like a good idea anyway. The immediate problem with the old install.bat was that it had quoting issues, and wouldn't work if the target directory's name contained spaces. This fixes that problem.
1 parent 8e33fc1 commit 6c534fd

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

src/tools/msvc/install.bat

+4-25
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
11
@echo off
22
REM src/tools/msvc/install.bat
3-
4-
if NOT "%1"=="" GOTO RUN_INSTALL
5-
6-
echo Invalid command line options.
7-
echo Usage: "install.bat <path>"
8-
echo.
9-
REM exit fix for pre-2003 shell especially if used on buildfarm
10-
if "%XP_EXIT_FIX%" == "yes" exit 1
11-
exit /b 1
12-
13-
:RUN_INSTALL
14-
15-
SETLOCAL
16-
17-
IF NOT EXIST buildenv.pl goto nobuildenv
18-
perl -e "require 'buildenv.pl'; while(($k,$v) = each %%ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat
19-
CALL bldenv.bat
20-
del bldenv.bat
21-
:nobuildenv
22-
23-
perl install.pl "%1" %2
24-
25-
REM exit fix for pre-2003 shell especially if used on buildfarm
26-
if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%
27-
exit /b %ERRORLEVEL%
3+
REM all the logic for this now belongs in install.pl. This file really
4+
REM only exists so you don't have to type "perl install.pl"
5+
REM Resist any temptation to add any logic here.
6+
@perl install.pl %*

src/tools/msvc/install.pl

+13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88

99
use Install qw(Install);
1010

11+
# buildenv.pl is for specifying the build environment settings
12+
# it should contain lines like:
13+
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
14+
15+
if (-e "src/tools/msvc/buildenv.pl")
16+
{
17+
require "src/tools/msvc/buildenv.pl";
18+
}
19+
elsif (-e "./buildenv.pl")
20+
{
21+
require "./buildenv.pl";
22+
}
23+
1124
my $target = shift || Usage();
1225
my $insttype = shift;
1326
Install($target, $insttype);

0 commit comments

Comments
 (0)