Skip to content

Commit 57e9ea2

Browse files
committed
Fix TAP tests and MSVC scripts for pathnames with spaces.
Back-patch relevant parts of commit 30b2731 into 9.1-9.3. Michael Paquier, Kyotaro Horiguchi Discussion: <20160704.160213.111134711.horiguchi.kyotaro@lab.ntt.co.jp>
1 parent 280a558 commit 57e9ea2

File tree

2 files changed

+35
-17
lines changed

2 files changed

+35
-17
lines changed

src/tools/msvc/Install.pm

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,12 +316,21 @@ sub GenerateTimezoneFiles
316316
my $mf = read_file("src/timezone/Makefile");
317317
$mf =~ s{\\\s*[\r\n]+}{}mg;
318318
$mf =~ /^TZDATA\s*:?=\s*(.*)$/m
319-
|| die "Could not find TZDATA row in timezone makefile\n";
319+
|| die "Could not find TZDATA line in timezone makefile\n";
320320
my @tzfiles = split /\s+/, $1;
321-
unshift @tzfiles, '';
321+
322322
print "Generating timezone files...";
323-
system("$conf\\zic\\zic -d \"$target/share/timezone\" "
324-
. join(" src/timezone/data/", @tzfiles));
323+
324+
my @args = ("$conf/zic/zic",
325+
'-d',
326+
"$target/share/timezone");
327+
foreach (@tzfiles)
328+
{
329+
my $tzfile = $_;
330+
push(@args, "src/timezone/data/$tzfile")
331+
}
332+
333+
system(@args);
325334
print "\n";
326335
}
327336

@@ -550,9 +559,10 @@ sub CopyIncludeFiles
550559
next unless (-d "src/include/$d");
551560

552561
EnsureDirectories("$target/include/server/$d");
553-
system(
554-
qq{xcopy /s /i /q /r /y src\\include\\$d\\*.h "$ctarget\\include\\server\\$d\\"}
555-
) && croak("Failed to copy include directory $d\n");
562+
my @args = ('xcopy', '/s', '/i', '/q', '/r', '/y',
563+
"src\\include\\$d\\*.h",
564+
"$ctarget\\include\\server\\$d\\");
565+
system(@args) && croak("Failed to copy include directory $d\n");
556566
}
557567
closedir($D);
558568

@@ -605,9 +615,11 @@ sub GenerateNLSFiles
605615

606616
EnsureDirectories($target, "share/locale/$lang",
607617
"share/locale/$lang/LC_MESSAGES");
608-
system(
609-
"\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo\" $_"
610-
) && croak("Could not run msgfmt on $dir\\$_");
618+
my @args = ("$nlspath\\bin\\msgfmt",
619+
'-o',
620+
"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo",
621+
$_);
622+
system(@args) && croak("Could not run msgfmt on $dir\\$_");
611623
print ".";
612624
}
613625
}

src/tools/msvc/vcregress.pl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,35 +282,41 @@ sub upgradecheck
282282
print "\nRunning initdb on old cluster\n\n";
283283
standard_initdb() or exit 1;
284284
print "\nStarting old cluster\n\n";
285-
system("pg_ctl start -l $logdir/postmaster1.log -w") == 0 or exit 1;
285+
my @args = ('pg_ctl', 'start', '-l', "$logdir/postmaster1.log", '-w');
286+
system(@args) == 0 or exit 1;
286287
print "\nSetting up data for upgrading\n\n";
287288
installcheck();
288289

289290
# now we can chdir into the source dir
290291
chdir "$topdir/contrib/pg_upgrade";
291292
print "\nDumping old cluster\n\n";
292-
system("pg_dumpall -f $tmp_root/dump1.sql") == 0 or exit 1;
293+
@args = ('pg_dumpall', '-f', "$tmp_root/dump1.sql");
294+
system(@args) == 0 or exit 1;
293295
print "\nStopping old cluster\n\n";
294296
system("pg_ctl -m fast stop") == 0 or exit 1;
295297
$ENV{PGDATA} = "$data";
296298
print "\nSetting up new cluster\n\n";
297299
standard_initdb() or exit 1;
298300
print "\nRunning pg_upgrade\n\n";
299-
system("pg_upgrade -d $data.old -D $data -b $bindir -B $bindir") == 0
300-
or exit 1;
301+
@args = ('pg_upgrade', '-d', "$data.old", '-D', $data, '-b', $bindir,
302+
'-B', $bindir);
303+
system(@args) == 0 or exit 1;
301304
print "\nStarting new cluster\n\n";
302-
system("pg_ctl -l $logdir/postmaster2.log -w start") == 0 or exit 1;
305+
@args = ('pg_ctl', '-l', "$logdir/postmaster2.log", '-w', 'start');
306+
system(@args) == 0 or exit 1;
303307
print "\nSetting up stats on new cluster\n\n";
304308
system(".\\analyze_new_cluster.bat") == 0 or exit 1;
305309
print "\nDumping new cluster\n\n";
306-
system("pg_dumpall -f $tmp_root/dump2.sql") == 0 or exit 1;
310+
@args = ('pg_dumpall', '-f', "$tmp_root/dump2.sql");
311+
system(@args) == 0 or exit 1;
307312
print "\nStopping new cluster\n\n";
308313
system("pg_ctl -m fast stop") == 0 or exit 1;
309314
print "\nDeleting old cluster\n\n";
310315
system(".\\delete_old_cluster.bat") == 0 or exit 1;
311316
print "\nComparing old and new cluster dumps\n\n";
312317

313-
system("diff -q $tmp_root/dump1.sql $tmp_root/dump2.sql");
318+
@args = ('diff', '-q', "$tmp_root/dump1.sql", "$tmp_root/dump2.sql");
319+
system(@args);
314320
$status = $?;
315321
if (!$status)
316322
{

0 commit comments

Comments
 (0)