Remove PostgreSQL::Test::Utils::perl2host completely
authorAndrew Dunstan <[email protected]>
Sun, 20 Feb 2022 13:55:06 +0000 (08:55 -0500)
committerAndrew Dunstan <[email protected]>
Sun, 20 Feb 2022 16:36:15 +0000 (11:36 -0500)
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[email protected]

src/test/perl/PostgresNode.pm
src/test/perl/TestLib.pm
src/test/recovery/t/025_stuck_on_old_timeline.pl

index 28741209c6c8ab2275f45742ed47317ac341689f..dafde431deac773d3ada568f2bd67e6f970c7cf7 100644 (file)
@@ -884,7 +884,7 @@ standby_mode=on
 sub enable_restoring
 {
    my ($self, $root_node) = @_;
-   my $path = TestLib::perl2host($root_node->archive_dir);
+   my $path = $root_node->archive_dir;
    my $name = $self->name;
 
    print "### Enabling WAL restore for node \"$name\"\n";
@@ -912,7 +912,7 @@ standby_mode = on
 sub enable_archiving
 {
    my ($self) = @_;
-   my $path   = TestLib::perl2host($self->archive_dir);
+   my $path   = $self->archive_dir;
    my $name   = $self->name;
 
    print "### Enabling WAL archiving for node \"$name\"\n";
index 3359b18420395d9a841bc247ec5ad4c3583e3ba7..c88037438daabe39ef79374f1ac56f79cc597565 100644 (file)
@@ -184,33 +184,6 @@ sub tempdir_short
    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;
-}
-
 =pod
 
 =item has_wal_read_bug()
index 4174adf152fe399f3511d1171103d97ddf504ed1..35c523f78ec1cc19a4a9f0560f8152b42470a763 100644 (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
 # that arise from use of backslashes. That means we need to double-quote all
 # the paths in the archive_command
-my $perlbin = TestLib::perl2host($^X);
+my $perlbin = $^X;
 $perlbin =~ s!\\!/!g if $TestLib::windows_os;
 my $archivedir_primary = $node_primary->archive_dir;
 $archivedir_primary =~ s!\\!/!g if $TestLib::windows_os;