[perl-TryCatch] Patch the failing invalid.t (rt#81978) and fix the BRs list
Petr Šabata
psabata at fedoraproject.org
Fri Feb 22 15:51:27 UTC 2013
commit eef280466a3eed18e32381e6c2b382ec8ca47eb6
Author: Petr Šabata <contyk at redhat.com>
Date: Fri Feb 22 16:51:23 2013 +0100
Patch the failing invalid.t (rt#81978) and fix the BRs list
TryCatch-1.003000-invalid.patch | 86 +++++++++++++++++++++++++++++++++++++++
perl-TryCatch.spec | 39 +++++++++++++-----
2 files changed, 114 insertions(+), 11 deletions(-)
---
diff --git a/TryCatch-1.003000-invalid.patch b/TryCatch-1.003000-invalid.patch
new file mode 100644
index 0000000..d988ada
--- /dev/null
+++ b/TryCatch-1.003000-invalid.patch
@@ -0,0 +1,86 @@
+diff --git a/t/invalid.t b/t/invalid.t
+index 955bcb7..b7f2531 100644
+--- a/t/invalid.t
++++ b/t/invalid.t
+@@ -5,7 +5,11 @@ use Test::More;
+ use Test::Exception;
+ use TryCatch;
+
+-my $line;
++require B::Hooks::EndOfScope;
++# after 0.11 'Hooks' changed some of our messages
++my $hooks_post_011 = ($B::Hooks::EndOfScope::VERSION > 0.11);
++
++my ($line, $expected_line, $regexp);
+
+ test_for_error(
+ qr/^block required after try at .*? line (\d+)\b/,
+@@ -22,8 +26,16 @@ is($line, 4, "Error from line 4");
+ # Its really *really* wierd that this 'fixes' things. I blame string evals
+ eval "use TryCatch; try {} catch" if $] >= 5.011000;
+
++if ($hooks_post_011) {
++ $regexp = qr/block required after catch .+at \(eval \d+\) line (\d+)\b/ms;
++ $expected_line = 9;
++}
++else {
++ $regexp = qr/^block required after catch at \(eval \d+\) line (\d+)\b/;
++ $expected_line = 5;
++}
+ test_for_error(
+- qr/^block required after catch at \(eval \d+\) line (\d+)\b/,
++ $regexp,
+ "no block after catch",
+ <<'EOC');
+ use TryCatch;
+@@ -33,10 +45,18 @@ catch
+ my $foo = 2;
+ EOC
+
+-is($line, 5, "Error from line 5");
++is($line, $expected_line, "Error from line $expected_line");
+
++if ($hooks_post_011) {
++ $regexp = qr/Parameter expected near '\^' in '\^Err \$e'.+\nsyntax error at \(eval \d+\) line (\d+)\b/ms;
++ $expected_line = 5;
++}
++else {
++ $regexp = qr/^Parameter expected near '\^' in '\^Err \$e' at \(eval \d+\) line (\d+)\b/;
++ $expected_line = 4;
++}
+ test_for_error(
+- qr/^Parameter expected near '\^' in '\^Err \$e' at \(eval \d+\) line (\d+)\b/,
++ $regexp,
+ "invalid catch signature",
+ <<'EOC');
+ # line 1
+@@ -47,10 +67,18 @@ catch (^Err $e) {}
+ next;
+ EOC
+
+-is($line, 4, "Error from line 4");
++is($line, $expected_line, "Error from line $expected_line");
+
++if ($hooks_post_011) {
++ $regexp = qr/Run-away catch signature at.+\nMissing right curly or square bracket at \(eval \d+\) line (\d+)/;
++ $expected_line = 5;
++}
++else {
++ $regexp = qr/^Run-away catch signature at \(eval \d+\) line (\d+)/;
++ $expected_line = 4;
++}
+ test_for_error(
+- qr/^Run-away catch signature at \(eval \d+\) line (\d+)/,
++ $regexp,
+ "invalid catch signature (missing parenthesis)",
+ <<'EOC');
+ use TryCatch;
+@@ -65,7 +93,7 @@ catch (
+ 1;
+ EOC
+
+-is($line, 4, "Error from line 4");
++is($line, $expected_line, "Error from line $expected_line");
+
+
+ test_for_error(
diff --git a/perl-TryCatch.spec b/perl-TryCatch.spec
index e2e2324..e16bcf9 100644
--- a/perl-TryCatch.spec
+++ b/perl-TryCatch.spec
@@ -1,21 +1,36 @@
Name: perl-TryCatch
Version: 1.003000
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: First class try catch semantics for Perl, without source filters
License: GPL+ or Artistic
Group: Development/Libraries
URL: http://search.cpan.org/dist/TryCatch/
Source0: http://www.cpan.org/authors/id/A/AS/ASH/TryCatch-%{version}.tar.gz
+# rt#81978
+Patch0: TryCatch-1.003000-invalid.patch
BuildRequires: perl(B::Hooks::EndOfScope) >= 0.08
BuildRequires: perl(B::Hooks::OP::Check) >= 0.18
BuildRequires: perl(B::Hooks::OP::PPAddr) >= 0.03
+BuildRequires: perl(Carp)
+BuildRequires: perl(Config)
+BuildRequires: perl(CPAN)
+BuildRequires: perl(Cwd)
BuildRequires: perl(Devel::Declare) >= 0.005007
+BuildRequires: perl(Devel::Declare::Context::Simple)
BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: perl(ExtUtils::Manifest)
+BuildRequires: perl(ExtUtils::MM_Unix)
+BuildRequires: perl(File::Find)
+BuildRequires: perl(File::Path)
+BuildRequires: perl(File::Spec)
BuildRequires: perl(FindBin)
BuildRequires: perl(lib)
+BuildRequires: perl(Module::Build)
BuildRequires: perl(Moose)
+BuildRequires: perl(Moose::Util::TypeConstraints)
BuildRequires: perl(MooseX::Types)
BuildRequires: perl(MooseX::Types::Structured)
+BuildRequires: perl(namespace::clean)
BuildRequires: perl(Parse::Method::Signatures) >= 1.003012
BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Scope::Upper) >= 0.06
@@ -24,6 +39,7 @@ BuildRequires: perl(Sub::Exporter) >= 0.979
BuildRequires: perl(Test::Exception)
BuildRequires: perl(Test::More) >= 0.88
BuildRequires: perl(Variable::Magic) >= 0.28
+BuildRequires: perl(vars)
BuildRequires: perl(warnings)
BuildRequires: perl(XSLoader)
Requires: perl(B::Hooks::OP::Check) >= 0.18
@@ -32,7 +48,7 @@ Requires: perl(MooseX::Types)
Requires: perl(Test::Exception)
Requires: perl(Test::More) >= 0.88
Requires: perl(Variable::Magic) >= 0.28
-Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%{?perl_default_filter}
@@ -45,20 +61,18 @@ handlers. And also eval/if isn't the nicest idiom.
%prep
%setup -q -n TryCatch-%{version}
+%patch0 -p1
%build
-%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
+perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}
%install
-make pure_install DESTDIR=$RPM_BUILD_ROOT
-
-find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
-find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
-find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
-
-%{_fixperms} $RPM_BUILD_ROOT/*
-chmod +x $RPM_BUILD_ROOT/%{perl_vendorarch}/{bench.pl,bench_ok.pl}
+make pure_install DESTDIR=%{buildroot}
+find %{buildroot} -type f -name .packlist -exec rm -f {} \;
+find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} \;
+%{_fixperms} %{buildroot}/*
+chmod +x %{buildroot}/%{perl_vendorarch}/{bench.pl,bench_ok.pl}
%check
make test
@@ -72,6 +86,9 @@ make test
%{_mandir}/man3/*
%changelog
+* Fri Feb 22 2013 Petr Šabata <contyk at redhat.com> - 1.003000-7
+- Patch the failing invalid.t (rt#81978) and fix the BRs list
+
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.003000-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
More information about the perl-devel
mailing list