]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove PostgreSQL::Test::Utils::perl2host completely
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 20 Feb 2022 13:55:06 +0000 (08:55 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 20 Feb 2022 15:47:40 +0000 (10:47 -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.5ohu3nslxgoygihl@alap3.anarazel.de

src/bin/pg_checksums/t/002_actions.pl
src/test/perl/PostgresNode.pm
src/test/perl/TestLib.pm
src/test/recovery/t/014_unlogged_reinit.pl
src/test/recovery/t/017_shm.pl
src/test/recovery/t/025_stuck_on_old_timeline.pl

index 4e4934532a30d27520d7d72ecbedaa03f64ff2ec..b7a64de64c7892dbb42a7d02b16b8325f541595e 100644 (file)
@@ -185,7 +185,6 @@ check_relation_corruption($node, 'corrupt1', 'pg_default');
 my $basedir        = $node->basedir;
 my $tablespace_dir = "$basedir/ts_corrupt_dir";
 mkdir($tablespace_dir);
-$tablespace_dir = TestLib::perl2host($tablespace_dir);
 $node->safe_psql('postgres',
        "CREATE TABLESPACE ts_corrupt LOCATION '$tablespace_dir';");
 check_relation_corruption($node, 'corrupt2', 'ts_corrupt');
index cb8a6423f4327ce360f6941d40770415474cb2ed..c7ac7d0f58cfdfab2dceb73f02e1689f15901b37 100644 (file)
@@ -970,7 +970,7 @@ primary_conninfo='$root_connstr'
 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";
@@ -1015,7 +1015,7 @@ sub set_standby_mode
 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 5c21cd56080d67306009010ff85be550e93ede2f..94bac189b58af94ceedd2cdeca5c153db1ef3c62 100644 (file)
@@ -193,33 +193,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 ee05e1a1ee11ced566d50d6ae93c554099b3a5f5..b7ebe700c23cc2f1a56469275c0bff63927161f3 100644 (file)
@@ -30,9 +30,7 @@ ok(-f "$pgdata/$baseUnloggedPath",        'main fork in base exists');
 
 my $tablespaceDir = TestLib::tempdir;
 
-my $realTSDir = TestLib::perl2host($tablespaceDir);
-
-$node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$realTSDir'");
+$node->safe_psql('postgres', "CREATE TABLESPACE ts1 LOCATION '$tablespaceDir'");
 $node->safe_psql('postgres',
        'CREATE UNLOGGED TABLE ts1_unlogged (id int) TABLESPACE ts1');
 
index 01772186754afcb5831d04d37971dc2dafa34c10..52f3dd993c9db1ee877c3e6ce63fc397ddd8e9ac 100644 (file)
@@ -102,7 +102,7 @@ log_ipcs();
 # Scenarios involving no postmaster.pid, dead postmaster, and a live backend.
 # Use a regress.c function to emulate the responsiveness of a backend working
 # through a CPU-intensive task.
-my $regress_shlib = TestLib::perl2host($ENV{REGRESS_SHLIB});
+my $regress_shlib = $ENV{REGRESS_SHLIB};
 $gnat->safe_psql('postgres', <<EOSQL);
 CREATE FUNCTION wait_pid(int)
    RETURNS void
index 9859c0b497623c6cec9e6b3da778cb1bf493441a..1e0373fe2acffc6ae9e45acee1b98afb5fb32bb4 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;