diff -Nru libre-engine-re2-perl-0.13/Changes libre-engine-re2-perl-0.14/Changes --- libre-engine-re2-perl-0.13/Changes 2015-01-18 22:58:24.000000000 +0000 +++ libre-engine-re2-perl-0.14/Changes 2021-01-31 15:25:15.000000000 +0000 @@ -1,3 +1,10 @@ +0.14 2021-01-31 +- Lexical $_ has been removed (Perl 5.24) (PR #1, thanks Tim Heaney) +- Expose the NamedCapturingGroups method (PR #2, thanks rouzier) +- Fix build on macOS by defaulting RE2 to use C++11 ("tr1/unordered_set" isn't provided by the clang C++ library + anymore and it's 2021) +- Link to GitHub issue tracker as CPAN RT is going away. + 0.13 2015-01-18 - Unbreak Windows build - Up minimum perl to 5.12 diff -Nru libre-engine-re2-perl-0.13/debian/changelog libre-engine-re2-perl-0.14/debian/changelog --- libre-engine-re2-perl-0.13/debian/changelog 2020-12-02 15:47:34.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/changelog 2021-02-07 01:09:58.000000000 +0000 @@ -1,32 +1,19 @@ -libre-engine-re2-perl (0.13-5build5) hirsute; urgency=medium +libre-engine-re2-perl (0.14-1) unstable; urgency=medium - * No-change rebuild for libre2 soname change. + [ upstream ] + * new release - -- Matthias Klose Wed, 02 Dec 2020 16:47:34 +0100 + [ Debian Janitor ] + * apply multi-arch hints: Multi-Arch: same -libre-engine-re2-perl (0.13-5build4) hirsute; urgency=medium + [ Jonas Smedegaard ] + * use debhelper compatibility level 13 (not 12) + * drop patches 1001 1002 adopted upstream + * unfuzz patch 2001 + * declare compliance with Debian Policy 4.5.1 + * copyright info: update coverage - * No-change rebuild for the perl update. - - -- Matthias Klose Mon, 09 Nov 2020 12:45:09 +0100 - -libre-engine-re2-perl (0.13-5build3) groovy; urgency=medium - - * No-change rebuild against libre2-8 - - -- Steve Langasek Mon, 27 Jul 2020 17:56:11 +0000 - -libre-engine-re2-perl (0.13-5build2) groovy; urgency=medium - - * No-change rebuild against libre2-7 - - -- Stefano Rivera Thu, 21 May 2020 23:23:02 -0700 - -libre-engine-re2-perl (0.13-5build1) groovy; urgency=medium - - * No-change rebuild against libre2-6 - - -- Steve Langasek Wed, 06 May 2020 03:50:50 +0000 + -- Jonas Smedegaard Sun, 07 Feb 2021 02:09:58 +0100 libre-engine-re2-perl (0.13-5) unstable; urgency=medium diff -Nru libre-engine-re2-perl-0.13/debian/control libre-engine-re2-perl-0.14/debian/control --- libre-engine-re2-perl-0.13/debian/control 2020-05-06 03:50:50.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/control 2021-02-07 01:08:17.000000000 +0000 @@ -2,15 +2,14 @@ Section: perl Priority: optional Build-Depends: - debhelper-compat (= 12), + debhelper-compat (= 13), libextutils-cppguess-perl, libextutils-pkgconfig-perl, libre2-dev, perl, -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian Perl Group +Maintainer: Debian Perl Group Uploaders: Jonas Smedegaard -Standards-Version: 4.5.0 +Standards-Version: 4.5.1 Testsuite: autopkgtest-pkg-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libre-engine-re2-perl.git Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libre-engine-re2-perl @@ -23,6 +22,7 @@ ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends}, +Multi-Arch: same Description: RE2 regex engine re::engine::RE2 replaces perl's regex engine in a given lexical scope with RE2. diff -Nru libre-engine-re2-perl-0.13/debian/copyright libre-engine-re2-perl-0.14/debian/copyright --- libre-engine-re2-perl-0.13/debian/copyright 2018-10-17 16:48:50.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/copyright 2021-02-07 01:08:59.000000000 +0000 @@ -36,7 +36,7 @@ License: Artistic or GPL-1+ Files: debian/* -Copyright: 2016-2018, Jonas Smedegaard +Copyright: 2016-2021, Jonas Smedegaard License-Grant: This program is free software: you can redistribute it and/or modify it diff -Nru libre-engine-re2-perl-0.13/debian/copyright_hints libre-engine-re2-perl-0.14/debian/copyright_hints --- libre-engine-re2-perl-0.13/debian/copyright_hints 2020-02-22 10:55:29.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/copyright_hints 2021-02-07 01:09:23.000000000 +0000 @@ -15,15 +15,14 @@ compat-cophh.h compat-rx.h debian/clean - debian/compat debian/control debian/gbp.conf - debian/patches/1001_avoid_lexical_underscore.patch - debian/patches/1002_variable_length_lookbehind.patch + debian/patches/1003_utf8_flag.patch debian/patches/2001_system_shared_lib.patch debian/patches/series debian/rules debian/source/format + debian/upstream debian/watch re2_xs.cc re2_xs.h @@ -52,18 +51,23 @@ License: UNKNOWN FIXME +Files: debian/copyright-check +Copyright: 2016-2017, Jonas Smedegaard +License: GPL-3+ + FIXME + Files: lib/re/engine/RE2.pm Copyright: 2006, Audrey Tang / 2007, Evar ArnfjErE Bjarmason. Copyright 2010 David Leadbeater. -License: Artistic or GPL-1+ +License: UNKNOWN FIXME Files: README Copyright: 2006, Audrey Tang 2007, Ævar Arnfjörð Bjarmason. Copyright 2010 David Leadbeater. -License: Artistic or GPL-1+ +License: UNKNOWN FIXME Files: ppport.h @@ -71,12 +75,7 @@ 2001, Paul Marquess. Version 3.x, Copyright (c) 2004-2009, Marcus Holland-Moritz. s*^(.*?)^=w+/ms; -License: Artistic or GPL-1+ - FIXME - -Files: debian/copyright-check -Copyright: 2016-2017, Jonas Smedegaard -License: GPL-3+ +License: UNKNOWN FIXME Files: debian/source/lintian-overrides diff -Nru libre-engine-re2-perl-0.13/debian/patches/1001_avoid_lexical_underscore.patch libre-engine-re2-perl-0.14/debian/patches/1001_avoid_lexical_underscore.patch --- libre-engine-re2-perl-0.13/debian/patches/1001_avoid_lexical_underscore.patch 2020-02-22 10:23:41.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/patches/1001_avoid_lexical_underscore.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: Avoid lexical underscore removed since Perl 5.24 -Author: Jonas Smedegaard -Bug: https://rt.cpan.org/Public/Bug/Display.html?id=108357 -Last-Update: 2020-02-22 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/t/ree-pcre/s.t -+++ b/t/ree-pcre/s.t -@@ -2,7 +2,7 @@ - use Test::More tests => 10; - use re::engine::RE2; - --my $_; -+#my $_; - - $_ = "ab"; - s/a//; diff -Nru libre-engine-re2-perl-0.13/debian/patches/1002_variable_length_lookbehind.patch libre-engine-re2-perl-0.14/debian/patches/1002_variable_length_lookbehind.patch --- libre-engine-re2-perl-0.13/debian/patches/1002_variable_length_lookbehind.patch 2019-06-06 20:34:05.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/patches/1002_variable_length_lookbehind.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -Description: Handle variable length lookbehind supported since Perl 5.29.9 -Origin: https://github.com/rurban/re-engine-PCRE2/commit/6b5cc9 -Author: Reini Urban -Bug: https://rt.cpan.org/Public/Bug/Display.html?id=129585 -Bug-Debian: https://bugs.debian.org/930049 -Last-Update: 2018-10-18 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/t/01.basic.t -+++ b/t/01.basic.t -@@ -8,8 +8,9 @@ - ok("Hello, world" =~ /Hello, (world)/); - is($1, 'world'); - -+# implemented in perl5 since 5.29.9 [perl #132367] - no re::engine::RE2; --is(eval '"Hello, world" =~ /(?<=Moose|Mo), (world)/', undef); -+ok(!eval '"Hello, world" =~ /(?<=Moose|Mo), (world)/'); # v5.29.9 returns '', before undef - - if (fork) { - ok(1); diff -Nru libre-engine-re2-perl-0.13/debian/patches/2001_system_shared_lib.patch libre-engine-re2-perl-0.14/debian/patches/2001_system_shared_lib.patch --- libre-engine-re2-perl-0.13/debian/patches/2001_system_shared_lib.patch 2018-10-18 09:41:57.000000000 +0000 +++ libre-engine-re2-perl-0.14/debian/patches/2001_system_shared_lib.patch 2021-02-07 01:07:03.000000000 +0000 @@ -24,7 +24,7 @@ PMLIBDIRS => ["lib"], OBJECT => join(" ", @objects), test => {TESTS => 't/*.t t/ree-pcre/*.t'}, -@@ -37,92 +37,4 @@ +@@ -41,92 +41,4 @@ } } @@ -107,7 +107,7 @@ -sub MY::postamble { - return < + +Returns a hash of the name captures and index. + +Example: + + my $named_captures = qr/(?P\w+) (?P\w+)/->named_captures; + is $named_captures->{a}, 1; + is $named_captures->{d}, 2; + +=item * C + +Return number of capture groups + +Example: + + my $captures = qr/(Hello), (world)/->number_of_capture_groups; + is $captures, 2; + =back =head1 PRAGMA OPTIONS @@ -225,8 +244,7 @@ =back -Please report bugs via RT in the normal way. (Or a patch at -L would be most welcome.) +Please report bugs or provide patches at . =head1 AUTHORS diff -Nru libre-engine-re2-perl-0.13/Makefile.PL libre-engine-re2-perl-0.14/Makefile.PL --- libre-engine-re2-perl-0.13/Makefile.PL 2015-01-18 22:58:24.000000000 +0000 +++ libre-engine-re2-perl-0.14/Makefile.PL 2021-01-31 15:19:14.000000000 +0000 @@ -31,8 +31,12 @@ if(eval { ExtUtils::MakeMaker->VERSION(6.46) }) { $opt{META_MERGE} = { + 'meta-spec' => { version => 2 }, resources => { - repository => 'https://github.com/dgl/re-engine-RE2' + repository => 'https://github.com/dgl/re-engine-RE2', + bugtracker => { + web => 'https://github.com/dgl/re-engine-RE2/issues', + } } } } @@ -116,7 +120,7 @@ sub MY::postamble { return <" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.140640", + "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", - "version" : "2" + "version" : 2 }, "name" : "re-engine-RE2", "no_index" : { @@ -30,16 +30,14 @@ "ExtUtils::CppGuess" : "0", "Test::More" : "0.88" } - }, - "runtime" : { - "requires" : {} } }, "release_status" : "stable", "resources" : { - "repository" : { - "url" : "https://github.com/dgl/re-engine-RE2" + "bugtracker" : { + "web" : "https://github.com/dgl/re-engine-RE2/issues" } }, - "version" : "0.13" + "version" : "0.14", + "x_serialization_backend" : "JSON::PP version 2.97001" } diff -Nru libre-engine-re2-perl-0.13/META.yml libre-engine-re2-perl-0.14/META.yml --- libre-engine-re2-perl-0.13/META.yml 2015-01-18 23:00:27.000000000 +0000 +++ libre-engine-re2-perl-0.14/META.yml 2021-01-31 15:34:05.000000000 +0000 @@ -8,7 +8,7 @@ ExtUtils::CppGuess: '0' Test::More: '0.88' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.140640' +generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -18,7 +18,7 @@ directory: - t - inc -requires: {} resources: - repository: https://github.com/dgl/re-engine-RE2 -version: '0.13' + bugtracker: https://github.com/dgl/re-engine-RE2/issues +version: '0.14' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libre-engine-re2-perl-0.13/RE2.xs libre-engine-re2-perl-0.14/RE2.xs --- libre-engine-re2-perl-0.13/RE2.xs 2014-08-09 10:11:06.000000000 +0000 +++ libre-engine-re2-perl-0.14/RE2.xs 2021-01-31 12:07:26.000000000 +0000 @@ -26,3 +26,27 @@ mXPUSHs(possible_min); mXPUSHs(possible_max); + +HV* +named_captures(SV *self) +PROTOTYPE: +CODE: + REGEXP* rx; + if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) + croak("qr// reference to a re::engine::RE2 instance required"); + rx = SvRX(self); + RETVAL = RE2_named_captures(aTHX_ rx); +OUTPUT: + RETVAL + +int +number_of_capture_groups(SV *self) +PROTOTYPE: +CODE: + REGEXP* rx; + if(!SvROK(self) || 0 != strcmp("re::engine::RE2", sv_reftype(SvRV(self), TRUE))) + croak("qr// reference to a re::engine::RE2 instance required"); + rx = SvRX(self); + RETVAL = RE2_number_of_capture_groups(aTHX_ rx); +OUTPUT: + RETVAL diff -Nru libre-engine-re2-perl-0.13/re2_xs.cc libre-engine-re2-perl-0.14/re2_xs.cc --- libre-engine-re2-perl-0.13/re2_xs.cc 2015-01-18 22:58:24.000000000 +0000 +++ libre-engine-re2-perl-0.14/re2_xs.cc 2021-01-31 12:07:26.000000000 +0000 @@ -341,4 +341,24 @@ return; } +extern "C" HV* RE2_named_captures(pTHX_ REGEXP* rx) +{ + const RE2 *const re2 = (RE2*) SvANY(rx)->pprivate; + const map ncg(re2->NamedCapturingGroups()); + HV* hv = newHV(); + for(map::const_iterator it = ncg.begin(); + it != ncg.end(); + ++it) { + hv_store(hv, it->first.data(), it->first.size(), newSViv(it->second), 0); + } + + return hv; +} + +extern "C" int RE2_number_of_capture_groups(pTHX_ REGEXP* rx) +{ + const RE2 *const re2 = (RE2*) SvANY(rx)->pprivate; + return re2->NumberOfCapturingGroups(); +} + // ex:sw=4 et: diff -Nru libre-engine-re2-perl-0.13/re2_xs.h libre-engine-re2-perl-0.14/re2_xs.h --- libre-engine-re2-perl-0.13/re2_xs.h 2014-08-09 10:11:06.000000000 +0000 +++ libre-engine-re2-perl-0.14/re2_xs.h 2021-01-31 12:07:26.000000000 +0000 @@ -5,5 +5,7 @@ START_EXTERN_C EXTERN_C const regexp_engine re2_engine; EXTERN_C void RE2_possible_match_range(pTHX_ REGEXP* rx, STRLEN len, SV **possible_min, SV **possible_max); +EXTERN_C HV* RE2_named_captures(pTHX_ REGEXP* rx); +EXTERN_C int RE2_number_of_capture_groups(pTHX_ REGEXP* rx); END_EXTERN_C diff -Nru libre-engine-re2-perl-0.13/README libre-engine-re2-perl-0.14/README --- libre-engine-re2-perl-0.13/README 2014-08-09 10:11:06.000000000 +0000 +++ libre-engine-re2-perl-0.14/README 2021-01-31 15:26:17.000000000 +0000 @@ -121,8 +121,8 @@ The above is true in Perl, false in RE2. To work around the issue you can write "\n?\z" when you mean Perl's "$". - Please report bugs via RT in the normal way. (Or a patch at - would be most welcome.) + Please report bugs or provide patches at + . AUTHORS David Leadbeater diff -Nru libre-engine-re2-perl-0.13/t/01.basic.t libre-engine-re2-perl-0.14/t/01.basic.t --- libre-engine-re2-perl-0.13/t/01.basic.t 2014-08-09 10:11:06.000000000 +0000 +++ libre-engine-re2-perl-0.14/t/01.basic.t 2021-01-31 12:07:26.000000000 +0000 @@ -1,5 +1,5 @@ use strict; -use Test::More tests => 6; +use Test::More tests => 7; use re::engine::RE2; ok("Hello, world" !~ /Goodbye, world/); @@ -8,8 +8,10 @@ ok("Hello, world" =~ /Hello, (world)/); is($1, 'world'); +is qr/(Hello), (world)/->number_of_capture_groups, 2; + no re::engine::RE2; -is(eval '"Hello, world" =~ /(?<=Moose|Mo), (world)/', undef); +is(eval '"Hello, world" =~ /^(?!Hello).*, (world)/', ''); if (fork) { ok(1); diff -Nru libre-engine-re2-perl-0.13/t/08.pos.t libre-engine-re2-perl-0.14/t/08.pos.t --- libre-engine-re2-perl-0.13/t/08.pos.t 2014-08-09 10:11:06.000000000 +0000 +++ libre-engine-re2-perl-0.14/t/08.pos.t 2021-01-31 12:07:26.000000000 +0000 @@ -1,5 +1,5 @@ #!perl -use Test::More tests => 18; +use Test::More tests => 19; my $str = "foo bar baz"; my @expected = split / /, $str; @@ -32,4 +32,6 @@ ok $str =~ /(?P\w+) (?P\w+)/; is_deeply \%+, { a => "foo", d => "bar" }; + + is_deeply qr/(?P\w+) (?P\w+)/->named_captures, { a => 1, d => 2 }; } diff -Nru libre-engine-re2-perl-0.13/t/ree-pcre/s.t libre-engine-re2-perl-0.14/t/ree-pcre/s.t --- libre-engine-re2-perl-0.13/t/ree-pcre/s.t 2014-08-09 10:11:06.000000000 +0000 +++ libre-engine-re2-perl-0.14/t/ree-pcre/s.t 2021-01-31 10:31:00.000000000 +0000 @@ -2,7 +2,7 @@ use Test::More tests => 10; use re::engine::RE2; -my $_; +local $_; $_ = "ab"; s/a//;