Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 11927e5

Browse files
committed
Fix TAP infrastructure to support Mingw better
archive_command and restore_command need to refer to Windows paths, not Msys virtual file system paths, as postgres is completely unaware of the latter, so prefix them with the Windows path to the virtual file system root. Clean psql output of carriage returns.
1 parent 9d5f071 commit 11927e5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/test/perl/PostgresNode.pm

+12-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ our @EXPORT = qw(
101101

102102
our ($test_localhost, $test_pghost, $last_port_assigned, @all_nodes);
103103

104+
# Windows path to virtual file system root
105+
106+
our $vfs_path = '';
107+
if ($Config{osname} eq 'msys')
108+
{
109+
$vfs_path = `cd / && pwd -W`;
110+
chomp $vfs_path;
111+
}
112+
104113
INIT
105114
{
106115

@@ -755,7 +764,7 @@ standby_mode=on
755764
sub enable_restoring
756765
{
757766
my ($self, $root_node) = @_;
758-
my $path = $root_node->archive_dir;
767+
my $path = $vfs_path . $root_node->archive_dir;
759768
my $name = $self->name;
760769

761770
print "### Enabling WAL restore for node \"$name\"\n";
@@ -783,7 +792,7 @@ standby_mode = on
783792
sub enable_archiving
784793
{
785794
my ($self) = @_;
786-
my $path = $self->archive_dir;
795+
my $path = $vfs_path. $self->archive_dir;
787796
my $name = $self->name;
788797

789798
print "### Enabling WAL archiving for node \"$name\"\n";
@@ -971,6 +980,7 @@ sub safe_psql
971980
print "\n#### End standard error\n";
972981
}
973982

983+
$stdout =~ s/\r//g if $TestLib::windows_os;
974984
return $stdout;
975985
}
976986

0 commit comments

Comments
 (0)