1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-22 02:52:08 +03:00

Remove PostgreSQL::Test::Utils::perl2host completely

Commit f1ac4a74de disabled this processing, and as nothing has broken (as
expected) here we proceed to remove the routine and adjust all the call
sites.

Backpatch to release 10

Discussion: https://postgr.es/m/0ba775a2-8aa0-0d56-d780-69427cf6f33d@dunslane.net
Discussion: https://postgr.es/m/20220125023609.5ohu3nslxgoygihl@alap3.anarazel.de
This commit is contained in:
Andrew Dunstan
2022-02-20 08:55:06 -05:00
parent 48bf71a129
commit b4a6ceed52
5 changed files with 5 additions and 40 deletions

View File

@ -937,7 +937,7 @@ standby_mode=on
sub enable_restoring sub enable_restoring
{ {
my ($self, $root_node) = @_; my ($self, $root_node) = @_;
my $path = TestLib::perl2host($root_node->archive_dir); my $path = $root_node->archive_dir;
my $name = $self->name; my $name = $self->name;
print "### Enabling WAL restore for node \"$name\"\n"; print "### Enabling WAL restore for node \"$name\"\n";
@ -966,7 +966,7 @@ standby_mode = on
sub enable_archiving sub enable_archiving
{ {
my ($self) = @_; my ($self) = @_;
my $path = TestLib::perl2host($self->archive_dir); my $path = $self->archive_dir;
my $name = $self->name; my $name = $self->name;
print "### Enabling WAL archiving for node \"$name\"\n"; print "### Enabling WAL archiving for node \"$name\"\n";

View File

@ -190,39 +190,6 @@ sub tempdir_short
return File::Temp::tempdir(CLEANUP => 1); return File::Temp::tempdir(CLEANUP => 1);
} }
# Translate a Perl file name to a host file name. Currently, this is a no-op
# except for the case of Perl=msys and host=mingw32. The subject need not
# exist, but its parent directory must exist.
sub perl2host
{
my ($subject) = @_;
return $subject unless $Config{osname} eq 'msys';
my $here = cwd;
my $leaf;
if (chdir $subject)
{
$leaf = '';
}
else
{
$leaf = '/' . basename $subject;
my $parent = dirname $subject;
chdir $parent or die "could not chdir \"$parent\": $!";
}
# this odd way of calling 'pwd -W' is the only way that seems to work.
my $dir = qx{sh -c "pwd -W"};
chomp $dir;
chdir $here;
return $dir . $leaf;
}
# For backward compatibility only.
sub real_dir
{
return perl2host(@_);
}
=pod =pod
=item has_wal_read_bug() =item has_wal_read_bug()

View File

@ -30,9 +30,7 @@ ok(-f "$pgdata/$baseUnloggedPath", 'main fork in base exists');
my $tablespaceDir = TestLib::tempdir; my $tablespaceDir = TestLib::tempdir;
my $realTSDir = TestLib::perl2host($tablespaceDir); $node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$tablespaceDir'");
$node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$realTSDir'");
$node->safe_psql('postgres', $node->safe_psql('postgres',
'CREATE UNLOGGED TABLE ts1_unlogged (id int) TABLESPACE ts1'); 'CREATE UNLOGGED TABLE ts1_unlogged (id int) TABLESPACE ts1');

View File

@ -102,7 +102,7 @@ log_ipcs();
# Scenarios involving no postmaster.pid, dead postmaster, and a live backend. # Scenarios involving no postmaster.pid, dead postmaster, and a live backend.
# Use a regress.c function to emulate the responsiveness of a backend working # Use a regress.c function to emulate the responsiveness of a backend working
# through a CPU-intensive task. # through a CPU-intensive task.
my $regress_shlib = TestLib::perl2host($ENV{REGRESS_SHLIB}); my $regress_shlib = $ENV{REGRESS_SHLIB};
$gnat->safe_psql('postgres', <<EOSQL); $gnat->safe_psql('postgres', <<EOSQL);
CREATE FUNCTION wait_pid(int) CREATE FUNCTION wait_pid(int)
RETURNS void RETURNS void

View File

@ -28,7 +28,7 @@ $node_primary->init(allows_streaming => 1, has_archiving => 1);
# Note: consistent use of forward slashes here avoids any escaping problems # Note: consistent use of forward slashes here avoids any escaping problems
# that arise from use of backslashes. That means we need to double-quote all # that arise from use of backslashes. That means we need to double-quote all
# the paths in the archive_command # the paths in the archive_command
my $perlbin = TestLib::perl2host($^X); my $perlbin = $^X;
$perlbin =~ s!\\!/!g if $TestLib::windows_os; $perlbin =~ s!\\!/!g if $TestLib::windows_os;
my $archivedir_primary = $node_primary->archive_dir; my $archivedir_primary = $node_primary->archive_dir;
$archivedir_primary =~ s!\\!/!g if $TestLib::windows_os; $archivedir_primary =~ s!\\!/!g if $TestLib::windows_os;