From f83419b7396fe5c64613838fd9eab8424591ad4a Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Tue, 5 Feb 2019 18:57:12 -0500 Subject: [PATCH] Fix included file path for modern perl Contrary to the comment on 772d4b76, only paths starting with "./" or "../" are considered relative to the current working directory by perl's "do" function. So this patch converts all the relevant cases to use "./" paths. This only affects MSVC. Backpatch to all live branches. --- src/tools/msvc/Install.pm | 4 ++-- src/tools/msvc/build.pl | 6 +++--- src/tools/msvc/install.pl | 2 +- src/tools/msvc/mkvcbuild.pl | 4 ++-- src/tools/msvc/pgbison.pl | 2 +- src/tools/msvc/pgflex.pl | 2 +- src/tools/msvc/vcregress.pl | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 7494bfa004..e0c2cd16be 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -59,8 +59,8 @@ sub Install # suppress warning about harmless redeclaration of $config no warnings 'misc'; - do "config_default.pl"; - do "config.pl" if (-f "config.pl"); + do "./config_default.pl"; + do "./config.pl" if (-f "config.pl"); } chdir("../../..") if (-f "../../../configure"); diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl index 35649fe5a2..1720bc873a 100644 --- a/src/tools/msvc/build.pl +++ b/src/tools/msvc/build.pl @@ -23,7 +23,7 @@ use Mkvcbuild; if (-e "src/tools/msvc/buildenv.pl") { - do "src/tools/msvc/buildenv.pl"; + do "./src/tools/msvc/buildenv.pl"; } elsif (-e "./buildenv.pl") { @@ -32,8 +32,8 @@ elsif (-e "./buildenv.pl") # set up the project our $config; -do "config_default.pl"; -do "config.pl" if (-f "src/tools/msvc/config.pl"); +do "./config_default.pl"; +do "./config.pl" if (-f "src/tools/msvc/config.pl"); my $vcver = Mkvcbuild::mkvcbuild($config); diff --git a/src/tools/msvc/install.pl b/src/tools/msvc/install.pl index 90425ca8fc..47cdba3536 100755 --- a/src/tools/msvc/install.pl +++ b/src/tools/msvc/install.pl @@ -18,7 +18,7 @@ use Install qw(Install); if (-e "src/tools/msvc/buildenv.pl") { - do "src/tools/msvc/buildenv.pl"; + do "./src/tools/msvc/buildenv.pl"; } elsif (-e "./buildenv.pl") { diff --git a/src/tools/msvc/mkvcbuild.pl b/src/tools/msvc/mkvcbuild.pl index 34e861375c..f5505b98c2 100644 --- a/src/tools/msvc/mkvcbuild.pl +++ b/src/tools/msvc/mkvcbuild.pl @@ -23,7 +23,7 @@ print "Warning: no config.pl found, using default.\n" unless (-f 'src/tools/msvc/config.pl'); our $config; -do 'src/tools/msvc/config_default.pl'; -do 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); +do './src/tools/msvc/config_default.pl'; +do './src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); Mkvcbuild::mkvcbuild($config); diff --git a/src/tools/msvc/pgbison.pl b/src/tools/msvc/pgbison.pl index e799d900fe..895e398c08 100644 --- a/src/tools/msvc/pgbison.pl +++ b/src/tools/msvc/pgbison.pl @@ -7,7 +7,7 @@ use File::Basename; # assume we are in the postgres source root -do 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; +do './src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; my ($bisonver) = `bison -V`; # grab first line $bisonver = (split(/\s+/, $bisonver))[3]; # grab version number diff --git a/src/tools/msvc/pgflex.pl b/src/tools/msvc/pgflex.pl index eba06f2824..aceed5ffd6 100644 --- a/src/tools/msvc/pgflex.pl +++ b/src/tools/msvc/pgflex.pl @@ -10,7 +10,7 @@ $ENV{CYGWIN} = 'nodosfilewarning'; # assume we are in the postgres source root -do 'src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; +do './src/tools/msvc/buildenv.pl' if -e 'src/tools/msvc/buildenv.pl'; my ($flexver) = `flex -V`; # grab first line $flexver = (split(/\s+/, $flexver))[1]; diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 4018313bf2..d0e8c6849b 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -23,8 +23,8 @@ chdir "../../.." if (-d "../../../src/tools/msvc"); my $topdir = getcwd(); my $tmp_installdir = "$topdir/tmp_install"; -do 'src/tools/msvc/config_default.pl'; -do 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); +do './src/tools/msvc/config_default.pl'; +do './src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); # buildenv.pl is for specifying the build environment settings # it should contain lines like: @@ -32,7 +32,7 @@ do 'src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl'); if (-e "src/tools/msvc/buildenv.pl") { - do "src/tools/msvc/buildenv.pl"; + do "./src/tools/msvc/buildenv.pl"; } my $what = shift || ""; -- 2.40.0