From 4d90c34d59f6a09f9778db89cb0e616acf128a83 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Aug 01 2023 14:52:57 +0000 Subject: Restore compatibility with Perl 5.38 --- diff --git a/perl-rpm-build-perl.spec b/perl-rpm-build-perl.spec index 9f31048..9982f22 100644 --- a/perl-rpm-build-perl.spec +++ b/perl-rpm-build-perl.spec @@ -1,6 +1,6 @@ Name: perl-rpm-build-perl Version: 0.82 -Release: 42%{?dist} +Release: 43%{?dist} # README: GPLv2+ # perl.prov: LGPLv2+ # ConstOptree/ppport.h: GPL+ or Artistic @@ -16,6 +16,8 @@ Patch1: rpm-build-perl-0.82-Adjust-to-perl-5.22.patch Patch2: rpm-build-perl-0.82-Port-to-OpSIBLING-like-macros-required-since-Perl-5..patch # Perl 5.36 compatibility, CPAN RT#142772 Patch3: rpm-build-perl-0.82-Adapt-tests-to-Perl-5.35.12.patch +# Perl 5.38 compatibility, bug #2222640, CPAN RT#148982 +Patch4: rpm-build-perl-0.82-Adjust-to-Perl-5.38.0.patch BuildRequires: gcc BuildRequires: make BuildRequires: perl-devel @@ -85,6 +87,7 @@ The provides/requires scripts packaged along with perl-rpm-build-perl. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build perl Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1 INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" @@ -107,6 +110,9 @@ make test %{_mandir}/man1/*.1* %changelog +* Tue Aug 01 2023 Petr Pisar - 0.82-43 +- Restore compatibility with Perl 5.38 (bug #2222640) + * Fri Jul 21 2023 Fedora Release Engineering - 0.82-42 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild diff --git a/rpm-build-perl-0.82-Adjust-to-Perl-5.38.0.patch b/rpm-build-perl-0.82-Adjust-to-Perl-5.38.0.patch new file mode 100644 index 0000000..33fdb40 --- /dev/null +++ b/rpm-build-perl-0.82-Adjust-to-Perl-5.38.0.patch @@ -0,0 +1,50 @@ +From e1342706be0f3e4926082f93bd25f8fa5358bc0b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 1 Aug 2023 15:32:22 +0200 +Subject: [PATCH] Adjust to Perl 5.38.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Perl 5.38.0 simplified how annonymous subroutines are compiled +. As a result, +t/01-B-PerlReq.t started to fail on hiding module loads from Try::Tiny +try {} blocks: + + $ prove -b t/01-B-PerlReq.t + t/01-B-PerlReq.t .. 9/? + # Failed test at t/01-B-PerlReq.t line 93. + # got: 'perl(Try/Tiny.pm) + # perl(Bar.pm)' + # expected: 'perl(Try/Tiny.pm) + # perl(Foo.pm) + # perl(Bar.pm)' + +This patch adjusted to the simplified optree. + +CPAN RT #148982 + +Signed-off-by: Petr Písař +--- + lib/B/PerlReq.pm | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/B/PerlReq.pm b/lib/B/PerlReq.pm +index 2e2a2ba..dbd837a 100644 +--- a/lib/B/PerlReq.pm ++++ b/lib/B/PerlReq.pm +@@ -273,7 +273,10 @@ my %TryCV; + sub grok_try { + return unless $INC{"Try/Tiny.pm"}; + my (undef, $op) = @_; +- if ($op->name eq "srefgen") { ++ if ($op->name eq "anoncode") { ++ # Since v5.38.0, PerlGH #20290 ++ } elsif ($op->name eq "srefgen") { ++ # Before v5.38.0 + $op = $op->first->first; + } elsif ($op->name eq "refgen") { + $op = $op->first->first->sibling; +-- +2.41.0 +