remove no longer necessary Perl compatibility hack

Started by Alvaro Herreraabout 3 years ago3 messages
#1Alvaro Herrera
alvherre@alvh.no-ip.org
1 attachment(s)

Hello

While messing about with Cluster.pm I noticed that we don't need the
hack to work around lack of parent.pm in very old Perl versions, because
we no longer support those versions (per commit 4c1532763a00). Trivial
patch attached.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"El que vive para el futuro es un iluso, y el que vive para el pasado,
un imbécil" (Luis Adler, "Los tripulantes de la noche")

Attachments:

0001-Remove-no-longer-needed-compatibility-hack.patchtext/x-diff; charset=us-asciiDownload
From f85b0302b343e7867274e05ec982ce3c1432eb59 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Mon, 17 Oct 2022 10:11:05 +0200
Subject: [PATCH] Remove no-longer-needed compatibility hack

Our Perl version requirement was raised to 5.14 by commit 4c1532763a00
---
 src/test/perl/PostgreSQL/Test/Cluster.pm | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 4a64cb749b..2a8131df4a 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -2940,10 +2940,7 @@ $SIG{TERM} = $SIG{INT} = sub
 package PostgreSQL::Test::Cluster::V_11
   ;    ## no critic (ProhibitMultiplePackages)
 
-# 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';
+use parent -norequire, qw(PostgreSQL::Test::Cluster);
 
 # https://www.postgresql.org/docs/11/release-11.html
 
@@ -2971,8 +2968,7 @@ sub init
 package PostgreSQL::Test::Cluster::V_10
   ;    ## no critic (ProhibitMultiplePackages)
 
-# use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);
-push @PostgreSQL::Test::Cluster::V_10::ISA, 'PostgreSQL::Test::Cluster::V_11';
+use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);
 
 # https://www.postgresql.org/docs/10/release-10.html
 
-- 
2.30.2

#2Richard Guo
guofenglinux@gmail.com
In reply to: Alvaro Herrera (#1)
Re: remove no longer necessary Perl compatibility hack

On Mon, Oct 17, 2022 at 4:24 PM Alvaro Herrera <alvherre@alvh.no-ip.org>
wrote:

While messing about with Cluster.pm I noticed that we don't need the
hack to work around lack of parent.pm in very old Perl versions, because
we no longer support those versions (per commit 4c1532763a00). Trivial
patch attached.

+1. Since we've got rid of perl of versions before 5.10.1, I see no
reason we do not do this.

Thanks
Richard

#3Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Richard Guo (#2)
Re: remove no longer necessary Perl compatibility hack

On 2022-Oct-17, Richard Guo wrote:

On Mon, Oct 17, 2022 at 4:24 PM Alvaro Herrera <alvherre@alvh.no-ip.org>
wrote:

While messing about with Cluster.pm I noticed that we don't need the
hack to work around lack of parent.pm in very old Perl versions, because
we no longer support those versions (per commit 4c1532763a00). Trivial
patch attached.

+1. Since we've got rid of perl of versions before 5.10.1, I see no
reason we do not do this.

Thanks for looking! Pushed now.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Al principio era UNIX, y UNIX habló y dijo: "Hello world\n".
No dijo "Hello New Jersey\n", ni "Hello USA\n".