diff --git a/perl-5.31.0-perl-134193-allow-CAPTURE-to-work-when-CAPTURE-comes.patch b/perl-5.31.0-perl-134193-allow-CAPTURE-to-work-when-CAPTURE-comes.patch new file mode 100644 index 0000000..59b05d2 --- /dev/null +++ b/perl-5.31.0-perl-134193-allow-CAPTURE-to-work-when-CAPTURE-comes.patch @@ -0,0 +1,59 @@ +From 22f05786af0b7f963440e47908cd5f35cf074c12 Mon Sep 17 00:00:00 2001 +From: Tony Cook +Date: Thu, 13 Jun 2019 10:05:15 +1000 +Subject: [PATCH] (perl #134193) allow %{^CAPTURE} to work when @{^CAPTURE} + comes first +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +gv_magicalize() is called when the GV is created, so when the array +was mentioned first, the hash wouldn't reach this code and the magic +wouldn't be added to the hash. + +This also fixes a similar problem with (%|@){^CAPTURE_ALL}, though +@{^CAPTURE_ALL} is unused at this point. + +Signed-off-by: Petr Písař +--- + ext/Tie-Hash-NamedCapture/t/tiehash.t | 3 +++ + gv.c | 6 ++---- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/ext/Tie-Hash-NamedCapture/t/tiehash.t b/ext/Tie-Hash-NamedCapture/t/tiehash.t +index 962754085f..cca05278f4 100644 +--- a/ext/Tie-Hash-NamedCapture/t/tiehash.t ++++ b/ext/Tie-Hash-NamedCapture/t/tiehash.t +@@ -3,6 +3,9 @@ use strict; + + use Test::More; + ++# this would break the hash magic setup [perl #134193] ++my ($ca, $c) = ( \@{^CAPTURE_ALL}, \@{^CAPTURE} ); ++ + my %hashes = ( + '+' => \%+, + '-' => \%-, +diff --git a/gv.c b/gv.c +index 46a32dcc20..2b83680898 100644 +--- a/gv.c ++++ b/gv.c +@@ -2032,13 +2032,11 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, + sv_magic(MUTABLE_SV(av), (SV*)n, PERL_MAGIC_regdata, NULL, 0); + SvREADONLY_on(av); + +- if (sv_type == SVt_PVHV || sv_type == SVt_PVGV) +- require_tie_mod_s(gv, '-', "Tie::Hash::NamedCapture",0); ++ require_tie_mod_s(gv, '-', "Tie::Hash::NamedCapture",0); + + } else /* %{^CAPTURE_ALL} */ + if (memEQs(name, len, "\003APTURE_ALL")) { +- if (sv_type == SVt_PVHV || sv_type == SVt_PVGV) +- require_tie_mod_s(gv, '+', "Tie::Hash::NamedCapture",0); ++ require_tie_mod_s(gv, '+', "Tie::Hash::NamedCapture",0); + } + break; + case '\005': /* $^ENCODING */ +-- +2.20.1 + diff --git a/perl-5.31.0-perl-134193-make-the-varname-match-the-names.patch b/perl-5.31.0-perl-134193-make-the-varname-match-the-names.patch new file mode 100644 index 0000000..0c12b6d --- /dev/null +++ b/perl-5.31.0-perl-134193-make-the-varname-match-the-names.patch @@ -0,0 +1,36 @@ +From d8422270033e0728e6a9cecb24cdbd123656e367 Mon Sep 17 00:00:00 2001 +From: Tony Cook +Date: Mon, 17 Jun 2019 11:46:00 +1000 +Subject: [PATCH] (perl #134193) make the varname match the %[+-] names +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +when loading Tie/Hash/NamedCapture.pm for the long name variants + +Signed-off-by: Petr Písař +--- + gv.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gv.c b/gv.c +index 2b83680898..652f5e737d 100644 +--- a/gv.c ++++ b/gv.c +@@ -2032,11 +2032,11 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, + sv_magic(MUTABLE_SV(av), (SV*)n, PERL_MAGIC_regdata, NULL, 0); + SvREADONLY_on(av); + +- require_tie_mod_s(gv, '-', "Tie::Hash::NamedCapture",0); ++ require_tie_mod_s(gv, '+', "Tie::Hash::NamedCapture",0); + + } else /* %{^CAPTURE_ALL} */ + if (memEQs(name, len, "\003APTURE_ALL")) { +- require_tie_mod_s(gv, '+', "Tie::Hash::NamedCapture",0); ++ require_tie_mod_s(gv, '-', "Tie::Hash::NamedCapture",0); + } + break; + case '\005': /* $^ENCODING */ +-- +2.20.1 + diff --git a/perl.spec b/perl.spec index b8f6ef9..d7e6f2e 100644 --- a/perl.spec +++ b/perl.spec @@ -210,6 +210,11 @@ Patch36: perl-5.31.0-Manuel-Mausz-is-now-a-perl-author.patch # fixed after 5.31.0 Patch37: perl-5.31.0-CAPTURE_ALL-was-intended-to-be-an-alias-for-make-it-.patch +# Fix %%{^CAPTURE} value when used after @{^CAPTURE}, RT#134193, +# fixed after 5.31.0 +Patch38: perl-5.31.0-perl-134193-allow-CAPTURE-to-work-when-CAPTURE-comes.patch +Patch39: perl-5.31.0-perl-134193-make-the-varname-match-the-names.patch + # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048 Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch @@ -2765,6 +2770,8 @@ Perl extension for Version Objects %patch35 -p1 %patch36 -p1 %patch37 -p1 +%patch38 -p1 +%patch39 -p1 %patch200 -p1 %patch201 -p1 @@ -2809,6 +2816,8 @@ perl -x patchlevel.h \ 'Fedora Patch35: Fix setting supplementar group IDs (RT#134169)' \ 'Fedora Patch36: Fix setting supplementar group IDs (RT#134169)' \ 'Fedora Patch37: Fix %%{^CAPTURE_ALL} to be an alias for %%- variable (RT#131867)' \ + 'Fedora Patch38: Fix %%{^CAPTURE} value when used after @{^CAPTURE} (RT#134193)' \ + 'Fedora Patch39: Fix %%{^CAPTURE} value when used after @{^CAPTURE} (RT#134193)' \ 'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \ 'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \ %{nil} @@ -5073,6 +5082,7 @@ popd (#RT133989) - Fix setting supplementar group IDs (RT#134169) - Fix %%{^CAPTURE_ALL} to be an alias for %%- variable (RT#131867) +- Fix %%{^CAPTURE} value when used after @{^CAPTURE} (RT#134193) * Tue Jun 11 2019 Jitka Plesnikova - 4:5.30.0-439 - Define %%perl_vendor*, %%perl_archlib, %%perl_privlib, because in rpm