]> granicus.if.org Git - postgresql/commitdiff
Turn install.bat into a pure one line wrapper fort he perl script.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Jul 2015 13:31:52 +0000 (16:31 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 7 Jul 2015 13:38:24 +0000 (16:38 +0300)
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.

I committed this to master yesterday, this is a backpatch of the same for
all supported versions.

src/tools/msvc/install.bat
src/tools/msvc/install.pl

index 1d2ab9c9b0a7128d809eaa2b600bf3d7bb148fcf..d03277eff2b74ece03a46069db199863885d09ea 100644 (file)
@@ -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 <path>"
-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"
-
-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 %*
index 28563a930d5a7d15ff79deb8fd06e5e6672eace9..e834cb1a644c810230c20095546b9fd91ebd2385 100755 (executable)
@@ -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();
 Install($target);