Skip to content

Commit 8358eac

Browse files
committed
Remove PostgreSQL::Test::Utils::perl2host completely
Commit f1ac4a7 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
1 parent e0d4123 commit 8358eac

File tree

6 files changed

+5
-35
lines changed

6 files changed

+5
-35
lines changed

src/bin/pg_checksums/t/002_actions.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ sub check_relation_corruption
185185
my $basedir = $node->basedir;
186186
my $tablespace_dir = "$basedir/ts_corrupt_dir";
187187
mkdir($tablespace_dir);
188-
$tablespace_dir = TestLib::perl2host($tablespace_dir);
189188
$node->safe_psql('postgres',
190189
"CREATE TABLESPACE ts_corrupt LOCATION '$tablespace_dir';");
191190
check_relation_corruption($node, 'corrupt2', 'ts_corrupt');

src/test/perl/PostgresNode.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ primary_conninfo='$root_connstr'
970970
sub enable_restoring
971971
{
972972
my ($self, $root_node) = @_;
973-
my $path = TestLib::perl2host($root_node->archive_dir);
973+
my $path = $root_node->archive_dir;
974974
my $name = $self->name;
975975

976976
print "### Enabling WAL restore for node \"$name\"\n";
@@ -1015,7 +1015,7 @@ sub set_standby_mode
10151015
sub enable_archiving
10161016
{
10171017
my ($self) = @_;
1018-
my $path = TestLib::perl2host($self->archive_dir);
1018+
my $path = $self->archive_dir;
10191019
my $name = $self->name;
10201020

10211021
print "### Enabling WAL archiving for node \"$name\"\n";

src/test/perl/TestLib.pm

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -193,33 +193,6 @@ sub tempdir_short
193193
return File::Temp::tempdir(CLEANUP => 1);
194194
}
195195

196-
# Translate a Perl file name to a host file name. Currently, this is a no-op
197-
# except for the case of Perl=msys and host=mingw32. The subject need not
198-
# exist, but its parent directory must exist.
199-
sub perl2host
200-
{
201-
my ($subject) = @_;
202-
return $subject unless $Config{osname} eq 'msys';
203-
my $here = cwd;
204-
my $leaf;
205-
if (chdir $subject)
206-
{
207-
$leaf = '';
208-
}
209-
else
210-
{
211-
$leaf = '/' . basename $subject;
212-
my $parent = dirname $subject;
213-
chdir $parent or die "could not chdir \"$parent\": $!";
214-
}
215-
216-
# this odd way of calling 'pwd -W' is the only way that seems to work.
217-
my $dir = qx{sh -c "pwd -W"};
218-
chomp $dir;
219-
chdir $here;
220-
return $dir . $leaf;
221-
}
222-
223196
=pod
224197
225198
=item has_wal_read_bug()

src/test/recovery/t/014_unlogged_reinit.pl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
my $tablespaceDir = TestLib::tempdir;
3232

33-
my $realTSDir = TestLib::perl2host($tablespaceDir);
34-
35-
$node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$realTSDir'");
33+
$node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$tablespaceDir'");
3634
$node->safe_psql('postgres',
3735
'CREATE UNLOGGED TABLE ts1_unlogged (id int) TABLESPACE ts1');
3836

src/test/recovery/t/017_shm.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ sub init_start
102102
# Scenarios involving no postmaster.pid, dead postmaster, and a live backend.
103103
# Use a regress.c function to emulate the responsiveness of a backend working
104104
# through a CPU-intensive task.
105-
my $regress_shlib = TestLib::perl2host($ENV{REGRESS_SHLIB});
105+
my $regress_shlib = $ENV{REGRESS_SHLIB};
106106
$gnat->safe_psql('postgres', <<EOSQL);
107107
CREATE FUNCTION wait_pid(int)
108108
RETURNS void

src/test/recovery/t/025_stuck_on_old_timeline.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# Note: consistent use of forward slashes here avoids any escaping problems
2929
# that arise from use of backslashes. That means we need to double-quote all
3030
# the paths in the archive_command
31-
my $perlbin = TestLib::perl2host($^X);
31+
my $perlbin = $^X;
3232
$perlbin =~ s!\\!/!g if $TestLib::windows_os;
3333
my $archivedir_primary = $node_primary->archive_dir;
3434
$archivedir_primary =~ s!\\!/!g if $TestLib::windows_os;

0 commit comments

Comments
 (0)