From: Heikki Linnakangas Date: Mon, 6 Jul 2015 19:18:26 +0000 (+0300) Subject: Turn install.bat into a pure one line wrapper fort he perl script. X-Git-Tag: REL9_6_BETA1~1725 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c534fd68568452adcc9ccecb557eff74f6f0f4d;p=postgresql 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. --- diff --git a/src/tools/msvc/install.bat b/src/tools/msvc/install.bat index bed08f1e12..d03277eff2 100644 --- a/src/tools/msvc/install.bat +++ b/src/tools/msvc/install.bat @@ -1,27 +1,6 @@ @echo off REM src/tools/msvc/install.bat - -if NOT "%1"=="" GOTO RUN_INSTALL - -echo Invalid command line options. -echo Usage: "install.bat " -echo. -REM exit fix for pre-2003 shell especially if used on buildfarm -if "%XP_EXIT_FIX%" == "yes" exit 1 -exit /b 1 - -:RUN_INSTALL - -SETLOCAL - -IF NOT EXIST buildenv.pl goto nobuildenv -perl -e "require 'buildenv.pl'; while(($k,$v) = each %%ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat -CALL bldenv.bat -del bldenv.bat -:nobuildenv - -perl install.pl "%1" %2 - -REM exit fix for pre-2003 shell especially if used on buildfarm -if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL% -exit /b %ERRORLEVEL% +REM all the logic for this now belongs in install.pl. This file really +REM only exists so you don't have to type "perl install.pl" +REM Resist any temptation to add any logic here. +@perl install.pl %* diff --git a/src/tools/msvc/install.pl b/src/tools/msvc/install.pl index 97e297e176..bde5b7c793 100755 --- a/src/tools/msvc/install.pl +++ b/src/tools/msvc/install.pl @@ -8,6 +8,19 @@ use warnings; use Install qw(Install); +# buildenv.pl is for specifying the build environment settings +# it should contain lines like: +# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}"; + +if (-e "src/tools/msvc/buildenv.pl") +{ + require "src/tools/msvc/buildenv.pl"; +} +elsif (-e "./buildenv.pl") +{ + require "./buildenv.pl"; +} + my $target = shift || Usage(); my $insttype = shift; Install($target, $insttype);