]> granicus.if.org Git - postgresql/commitdiff
Fix perl searchpath for modern perl for MSVC tools
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 28 Oct 2018 16:22:32 +0000 (12:22 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 28 Oct 2018 16:23:19 +0000 (12:23 -0400)
Modern versions of perl no longer include the current directory in the
perl searchpath, as it's insecure. Instead of adding the current
directory, we get around the problem by adding the directory where the
script lives.

Problem noted by Victor Wagner.

Solution adapted from buildfarm client code.

Backpatch to all live versions.

src/tools/msvc/install.pl
src/tools/msvc/mkvcbuild.pl
src/tools/msvc/vcregress.pl

index b2d7f9e040b4d774d57e406ebf8b7e3179f14ecc..90425ca8fc68ebe70cfe41031f8c846d421ae67f 100755 (executable)
@@ -6,6 +6,10 @@
 use strict;
 use warnings;
 
+use File::Basename;
+use File::Spec;
+BEGIN  { use lib File::Spec->rel2abs(dirname(__FILE__)); }
+
 use Install qw(Install);
 
 # buildenv.pl is for specifying the build environment settings
index 9255dff022d0f23d8c7bf1b89415ce1c70f5fccf..34e861375c00652c272e035806627bd922603a31 100644 (file)
@@ -7,6 +7,10 @@
 use strict;
 use warnings;
 
+use File::Basename;
+use File::Spec;
+BEGIN  { use lib File::Spec->rel2abs(dirname(__FILE__)); }
+
 use Mkvcbuild;
 
 chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src');
index ce5c976c16efefa91b026d3bd9680e91d417adbc..26ab707d9f5a5262a682d2a2043014d004b16c3b 100644 (file)
@@ -11,6 +11,8 @@ use File::Basename;
 use File::Copy;
 use File::Find ();
 use File::Path qw(rmtree);
+use File::Spec;
+BEGIN  { use lib File::Spec->rel2abs(dirname(__FILE__)); }
 
 use Install qw(Install);