Remove use of perl parent module in Cluster.pm
authorAndrew Dunstan <andrew@dunslane.net>
Thu, 31 Mar 2022 18:10:47 +0000 (14:10 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 31 Mar 2022 18:10:47 +0000 (14:10 -0400)
Commit fb16d2c658 used the old but not quite old enough parent module,
which dates to perl version 5.10.1 as a core module. We still have a
dinosaur or two running older versions of perl, so rather than require
an upgrade in those we simply do in place what parent.pm's import()
would have done for us.

Reviewed by Tom Lane

Discussion: https://postgr.es/m/474104.1648685981@sss.pgh.pa.us

src/test/perl/PostgreSQL/Test/Cluster.pm

index 1cbf90c0536d1071ccfc09224c54aaf4758626a9..b4ebc999356fb17e0c7872f397955c88a0cf4b48 100644 (file)
@@ -2918,7 +2918,10 @@ sub corrupt_page_checksum
 
 package PostgreSQL::Test::Cluster::V_11; ## no critic (ProhibitMultiplePackages)
 
-use parent -norequire, qw(PostgreSQL::Test::Cluster);
+# parent.pm is not present in all perl versions before 5.10.1, so instead
+# do directly what it would do for this:
+# use parent -norequire, qw(PostgreSQL::Test::Cluster);
+push @PostgreSQL::Test::Cluster::V_11::ISA, 'PostgreSQL::Test::Cluster';
 
 # https://www.postgresql.org/docs/11/release-11.html
 
@@ -2945,7 +2948,8 @@ sub init
 
 package PostgreSQL::Test::Cluster::V_10; ## no critic (ProhibitMultiplePackages)
 
-use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);
+# use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);
+push @PostgreSQL::Test::Cluster::V_10::ISA, 'PostgreSQL::Test::Cluster::V_11';
 
 # https://www.postgresql.org/docs/10/release-10.html