From 6c54f8e4d9d7c30f3b684493d0575ef726734743 Mon Sep 17 00:00:00 2001 From: Paul Howarth <p...@city-fan.org> Date: Mon, 22 Aug 2016 11:31:11 +0100 Subject: Update to 0.2501
- New upstream release 0.2501 - Fix "Redundant argument in sprintf" warning on Perl 5.21.2 - Classify buildreqs by usage - Switch to ExtUtils::MakeMaker flow - Package LICENSE - Add test case to verify fix for #1273668 (to_string() appends 'undef' to array attribute) - Make %files list more explicit --- .gitignore | 1 + perl-Exception-Base.spec | 83 +++++++++++++++++++++++++++++++++++----------- sources | 2 +- to_string_changes_errors.t | 24 ++++++++++++++ 4 files changed, 90 insertions(+), 20 deletions(-) create mode 100644 to_string_changes_errors.t diff --git a/.gitignore b/.gitignore index 4bde678..2b6b163 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Exception-Base-0.24.tar.gz /Exception-Base-0.2401.tar.gz /Exception-Base-0.25.tar.gz +/Exception-Base-0.2501.tar.gz diff --git a/perl-Exception-Base.spec b/perl-Exception-Base.spec index 6ac04e5..4c97b00 100644 --- a/perl-Exception-Base.spec +++ b/perl-Exception-Base.spec @@ -1,17 +1,43 @@ Name: perl-Exception-Base -Version: 0.2500 +Version: 0.2501 Release: 1%{?dist} Summary: Lightweight exceptions License: GPL+ or Artistic - URL: http://search.cpan.org/dist/Exception-Base/ -Source0: http://www.cpan.org/authors/id/D/DE/DEXTER/Exception-Base-0.25.tar.gz - +Source0: http://www.cpan.org/authors/id/D/DE/DEXTER/Exception-Base-%{version}.tar.gz +Source2: to_string_changes_errors.t BuildArch: noarch -BuildRequires: perl(Module::Build) +# Module Build +BuildRequires: coreutils +BuildRequires: findutils +BuildRequires: make +BuildRequires: perl +BuildRequires: perl-generators +BuildRequires: perl(ExtUtils::MakeMaker) +# Module Runtime +BuildRequires: perl(constant) +BuildRequires: perl(overload) +BuildRequires: perl(Scalar::Util) +BuildRequires: perl(strict) +BuildRequires: perl(Symbol) +BuildRequires: perl(warnings) +# Test Suite +BuildRequires: perl(base) +BuildRequires: perl(Carp) +BuildRequires: perl(Cwd) +BuildRequires: perl(File::Basename) +BuildRequires: perl(File::Spec) +BuildRequires: perl(if) BuildRequires: perl(Test::Unit::Lite) -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) - +# Test for https://bugzilla.redhat.com/show_bug.cgi?id=1273668 +BuildRequires: perl(Storable) +BuildRequires: perl(Test::More) +# Dependencies +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(Scalar::Util) +Requires: perl(Symbol) + +# Avoid doc-file dependencies %{?perl_default_filter} %description @@ -19,30 +45,49 @@ This class implements a fully OO exception mechanism similar to Exception::Class or Class::Throwable. It provides a simple interface allowing programmers to declare exception classes. These classes can be thrown and caught. Each uncaught exception prints full stack trace if the -default verbosity is uppered for debugging purposes. +default verbosity is increased for debugging purposes. %prep -%setup -q -n Exception-Base-0.25 +%setup -q -n Exception-Base-%{version} %build -%{__perl} Build.PL installdirs=vendor -./Build +perl Makefile.PL INSTALLDIRS=vendor +make %{?_smp_mflags} %install -./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 -find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \; - -%{_fixperms} $RPM_BUILD_ROOT/* +make pure_install DESTDIR=%{buildroot} +find %{buildroot} -type f -name .packlist -delete +%{_fixperms} %{buildroot} %check -./Build test +make test + +# to_string() appends 'undef' to array attribute prior to 0.2501 +# https://bugzilla.redhat.com/show_bug.cgi?id=1273668 +# https://github.com/dex4er/perl-Exception-Base/issues/3 +make test TEST_FILES=%{SOURCE2} %files -%doc Changes Incompatibilities README -%{perl_vendorlib}/* -%{_mandir}/man3/* +%if 0%{?_licensedir:1} +%license LICENSE +%else +%doc LICENSE +%endif +%doc Changes Incompatibilities README examples/ +%{perl_vendorlib}/Exception/ +%{_mandir}/man3/Exception::Base.3* %changelog +* Mon Aug 22 2016 Paul Howarth <p...@city-fan.org> - 0.2501-1 +- Update to 0.2501 + - Fix "Redundant argument in sprintf" warning on Perl 5.21.2 +- Classify buildreqs by usage +- Switch to ExtUtils::MakeMaker flow +- Package LICENSE +- Add test case to verify fix for #1273668 + (to_string() appends 'undef' to array attribute) +- Make %%files list more explicit + * Sun Jun 02 2013 Emmanuel Seyman <emman...@seyman.fr> - 0.2500-1 - Update to 0.25 diff --git a/sources b/sources index 593241d..343b3a9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7aad69250044146a641fe34a2f8642dd Exception-Base-0.25.tar.gz +1c633ce4ce9b4c4dd2676cd0663a35f7 Exception-Base-0.2501.tar.gz diff --git a/to_string_changes_errors.t b/to_string_changes_errors.t new file mode 100644 index 0000000..38b3fb7 --- /dev/null +++ b/to_string_changes_errors.t @@ -0,0 +1,24 @@ +#!/bin/perl +use warnings; +use strict; + +use Test::More tests => 1; +use Storable; + +use Exception::Base + 'MyException', => { + message => 'Validation error', + has => [ qw(class errors) ], + string_attributes => [ 'message', 'class', 'errors' ] + }; +eval { + MyException->throw( + class => __PACKAGE__, + errors => ["error 1", "error 2", "error 3"] + ); +}; + +my $exception = $@; +my $saved_errors = Storable::dclone($exception->errors()); +$exception->to_string(); +is_deeply($exception->errors(), $saved_errors, "to_string() does not modify errors() value"); -- cgit v0.12 http://pkgs.fedoraproject.org/cgit/perl-Exception-Base.git/commit/?h=epel7&id=6c54f8e4d9d7c30f3b684493d0575ef726734743 -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org