From 95d981338b241ce1d1b2346cfe2df509bb7243ca Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Fri, 18 Feb 2022 17:00:03 -0500 Subject: 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 --- src/test/perl/PostgreSQL/Test/Utils.pm | 58 ---------------------------------- 1 file changed, 58 deletions(-) (limited to 'src/test/perl/PostgreSQL/Test/Utils.pm') diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm index 31e2b0315ee..fc8ca741943 100644 --- a/src/test/perl/PostgreSQL/Test/Utils.pm +++ b/src/test/perl/PostgreSQL/Test/Utils.pm @@ -24,7 +24,6 @@ PostgreSQL::Test::Utils - helper module for writing PostgreSQL's C tests. # Miscellanea print "on Windows" if $PostgreSQL::Test::Utils::windows_os; - my $path = PostgreSQL::Test::Utils::perl2host($backup_dir); ok(check_mode_recursive($stream_dir, 0700, 0600), "check stream dir permissions"); PostgreSQL::Test::Utils::system_log('pg_ctl', 'kill', 'QUIT', $slow_pid); @@ -297,61 +296,6 @@ sub tempdir_short =pod -=item perl2host() - -Translate a virtual 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 or grandparent directory must exist unless cygpath is -available. - -The returned path uses forward slashes but has no trailing slash. - -=cut - -sub perl2host -{ - my ($subject) = @_; - return $subject; - if ($is_msys2) - { - # get absolute, windows type path - my $path = qx{cygpath -a -m "$subject"}; - if (!$?) - { - chomp $path; - $path =~ s!/$!!; - return $path if $path; - } - # fall through if this didn't work. - } - my $here = cwd; - my $leaf; - if (chdir $subject) - { - $leaf = ''; - } - else - { - $leaf = '/' . basename $subject; - my $parent = dirname $subject; - if (!chdir $parent) - { - $leaf = '/' . basename($parent) . $leaf; - $parent = dirname $parent; - 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; - $dir =~ s!/$!!; - chdir $here; - return $dir . $leaf; -} - -=pod - =item has_wal_read_bug() Returns true if $tmp_check is subject to a sparc64+ext4 bug that causes WAL @@ -727,8 +671,6 @@ sub dir_symlink my $newname = shift; if ($windows_os) { - $oldname = perl2host($oldname); - $newname = perl2host($newname); $oldname =~ s,/,\\,g; $newname =~ s,/,\\,g; my $cmd = qq{mklink /j "$newname" "$oldname"}; -- cgit v1.2.3