Teach RPM the package name provided in Perl alias packages.
authorNoah Misch <[email protected]>
Wed, 7 Aug 2024 18:43:34 +0000 (11:43 -0700)
committerNoah Misch <[email protected]>
Wed, 7 Aug 2024 18:43:45 +0000 (11:43 -0700)
When commit 1185be355462d1dc7e2950a7e52eb7ca0cb6f3c8 introduced
installation of a file containing "use PostgreSQL::Test::Utils", the RPM
Package Manager said "nothing provides perl(PostgreSQL::Test::Utils)".
Discussed on pgsql-packagers.  Back-patch to v12, v13, and v14 only;
newer versions don't have the alias packages.

Reviewed by Andrew Dunstan, Tom Lane, and John Harvey.  Reported by John
Harvey.

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

index 14e9138a394fd382a389c98a7e9ec657aa6200fd..c0c275a291b79b9e67bcb4e2199321592e5c6e89 100644 (file)
@@ -10,4 +10,10 @@ use warnings;
 BEGIN { *PostgreSQL::Test::Cluster:: = \*PostgresNode::; }
 use PostgresNode ();
 
+# There's no runtime requirement for the following package declaration, but it
+# convinces the RPM Package Manager that this file provides the Perl package
+# in question.  Perl v5.10.1 segfaults if a declaration of the to-be-aliased
+# package precedes the aliasing itself, hence the abnormal placement.
+package PostgreSQL::Test::Cluster;
+
 1;
index 2d15bbf21d7e06867148ceffce2849e67daba7ce..3b77a6e95d2cfcb3b58a9ca2516c0c4a614944db 100644 (file)
@@ -8,4 +8,10 @@ use warnings;
 BEGIN { *PostgreSQL::Test::Utils:: = \*TestLib::; }
 use TestLib ();
 
+# There's no runtime requirement for the following package declaration, but it
+# convinces the RPM Package Manager that this file provides the Perl package
+# in question.  Perl v5.10.1 segfaults if a declaration of the to-be-aliased
+# package precedes the aliasing itself, hence the abnormal placement.
+package PostgreSQL::Test::Utils;
+
 1;