aboutsummaryrefslogtreecommitdiff
path: root/src/tools/msvc/Install.pm
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-07-09 16:47:39 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-07-09 16:47:39 -0400
commit02a898b00cd9f7175691b58fb567b51a53bdaad2 (patch)
treeecc4c387858a079fca7eebe8fe45f33617bb7893 /src/tools/msvc/Install.pm
parent2dc7da91054ee5135fae35fafe60bf2803d4d836 (diff)
downloadpostgresql-02a898b00cd9f7175691b58fb567b51a53bdaad2.tar.gz
postgresql-02a898b00cd9f7175691b58fb567b51a53bdaad2.zip
Fix TAP tests and MSVC scripts for pathnames with spaces.
Change assorted places in our Perl code that did things like system("prog $path/file"); to do it more like system('prog', "$path/file"); which is safe against spaces and other special characters in the path variable. The latter was already the prevailing style, but a few bits of code hadn't gotten this memo. Back-patch to 9.4 as relevant. Michael Paquier, Kyotaro Horiguchi Discussion: <20160704.160213.111134711.horiguchi.kyotaro@lab.ntt.co.jp>
Diffstat (limited to 'src/tools/msvc/Install.pm')
-rw-r--r--src/tools/msvc/Install.pm32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 809060343a8..2600fb6ca2e 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -343,12 +343,21 @@ sub GenerateTimezoneFiles
my $mf = read_file("src/timezone/Makefile");
$mf =~ s{\\\s*[\r\n]+}{}mg;
$mf =~ /^TZDATA\s*:?=\s*(.*)$/m
- || die "Could not find TZDATA row in timezone makefile\n";
+ || die "Could not find TZDATA line in timezone makefile\n";
my @tzfiles = split /\s+/, $1;
- unshift @tzfiles, '';
+
print "Generating timezone files...";
- system("$conf\\zic\\zic -d \"$target/share/timezone\" "
- . join(" src/timezone/data/", @tzfiles));
+
+ my @args = ("$conf/zic/zic",
+ '-d',
+ "$target/share/timezone");
+ foreach (@tzfiles)
+ {
+ my $tzfile = $_;
+ push(@args, "src/timezone/data/$tzfile")
+ }
+
+ system(@args);
print "\n";
}
@@ -581,9 +590,10 @@ sub CopyIncludeFiles
next unless (-d "src/include/$d");
EnsureDirectories("$target/include/server/$d");
- system(
-qq{xcopy /s /i /q /r /y src\\include\\$d\\*.h "$ctarget\\include\\server\\$d\\"}
- ) && croak("Failed to copy include directory $d\n");
+ my @args = ('xcopy', '/s', '/i', '/q', '/r', '/y',
+ "src\\include\\$d\\*.h",
+ "$ctarget\\include\\server\\$d\\");
+ system(@args) && croak("Failed to copy include directory $d\n");
}
closedir($D);
@@ -636,9 +646,11 @@ sub GenerateNLSFiles
EnsureDirectories($target, "share/locale/$lang",
"share/locale/$lang/LC_MESSAGES");
- system(
-"\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo\" $_"
- ) && croak("Could not run msgfmt on $dir\\$_");
+ my @args = ("$nlspath\\bin\\msgfmt",
+ '-o',
+ "$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo",
+ $_);
+ system(@args) && croak("Could not run msgfmt on $dir\\$_");
print ".";
}
}