From 017447fe537260bd04ccb6c8c1ee9366160d5994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corse...@fedoraproject.org> Date: Thu, 15 Jun 2017 10:55:55 +0200 Subject: Add perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch (https://bugzilla.redhat.com/attachment.cgi?id=1275936, RHBZ#1435166). Modernize spec.
--- ...0-Adapt-to-changes-in-Cache-FastMmap-1.45.patch | 71 ++++++++++++++++++++++ perl-CHI.spec | 22 +++++-- 2 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch diff --git a/perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch b/perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch new file mode 100644 index 0000000..839d68a --- /dev/null +++ b/perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch @@ -0,0 +1,71 @@ +From 7fd8a51f2fcd362e390a94fb2fbef6ccef0e0a45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> +Date: Wed, 3 May 2017 16:57:52 +0200 +Subject: [PATCH] Adapt to changes in Cache-FastMmap-1.45 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Cache-FastMmap-1.45 deprecated raw_values constructor argument in +favor of new serializer argument. This changes caused +t/smoke-Driver-CacheCache.t to fail. + +This patch uses serializer with Cache::FastMmap >= 1.45, otherwise the old +raw_values. + +CPAN RT#120705 + +Signed-off-by: Petr Písař <ppi...@redhat.com> +--- + lib/CHI/Driver/FastMmap.pm | 10 +++++++--- + lib/CHI/t/Driver/FastMmap.pm | 6 +++++- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/lib/CHI/Driver/FastMmap.pm b/lib/CHI/Driver/FastMmap.pm +index 521306c..4cadd13 100644 +--- a/lib/CHI/Driver/FastMmap.pm ++++ b/lib/CHI/Driver/FastMmap.pm +@@ -21,7 +21,11 @@ sub BUILD { + mkpath( $self->root_dir, 0, $self->dir_create_mode ) + if !-d $self->root_dir; + $self->{fm_params} = { +- raw_values => 1, ++ ( ++ ($Cache::FastMmap::VERSION >= 1.45) ? ++ (serializer => '') : ++ (raw_values => 1) ++ ), + unlink_on_exit => 0, + share_file => catfile( + $self->root_dir, +@@ -107,8 +111,8 @@ though not between hosts. + To support namespaces, this driver takes a directory parameter rather than a + file, and creates one Cache::FastMMap file for each namespace. + +-Because CHI handles serialization automatically, we pass the C<raw_values> flag +-as 1; and to conform to the CHI API, we pass C<unlink_on_exit> as 0, so that ++Because CHI handles serialization automatically, we pass the C<serializer> flag ++as ''; and to conform to the CHI API, we pass C<unlink_on_exit> as 0, so that + all cache files are permanent. + + =head1 REQUIREMENTS +diff --git a/lib/CHI/t/Driver/FastMmap.pm b/lib/CHI/t/Driver/FastMmap.pm +index dd71ab2..2cc835d 100644 +--- a/lib/CHI/t/Driver/FastMmap.pm ++++ b/lib/CHI/t/Driver/FastMmap.pm +@@ -35,7 +35,11 @@ sub test_fm_cache : Tests { + my %defaults = ( + unlink_on_exit => 0, + empty_on_exit => 0, +- raw_values => 1, ++ ( ++ ($Cache::FastMmap::VERSION >= 1.45) ? ++ (serialize => 0) : ++ (raw_values => 1) ++ ), + ); + while ( my ( $key, $value ) = each(%defaults) ) { + is( $fm_cache->{$key} || 0, $value, "$key = $value by default" ); +-- +2.7.4 + diff --git a/perl-CHI.spec b/perl-CHI.spec index 539588f..d162f59 100644 --- a/perl-CHI.spec +++ b/perl-CHI.spec @@ -1,19 +1,24 @@ Name: perl-CHI Version: 0.60 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Unified cache handling interface License: GPL+ or Artistic -Group: Development/Libraries URL: http://search.cpan.org/dist/CHI/ Source0: http://www.cpan.org/authors/id/J/JS/JSWARTZ/CHI-%{version}.tar.gz # Workaround "Unescaped left brace in regex is deprecated" Patch0: perl-CHI-0.60-perl-5.22-regex.diff +# RHBZ#1275936 +Patch1: perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch + BuildArch: noarch %bcond_with author_tests %bcond_without smoke_tests +BuildRequires: %{__perl} +BuildRequires: %{__make} + BuildRequires: perl-generators BuildRequires: perl(Carp::Assert) >= 0.20 BuildRequires: perl(Compress::Zlib) @@ -86,7 +91,6 @@ CHI provides a unified caching API, designed to assist a developer in persisting data for a specified period of time. %package Test -Group: Development/Libraries Summary: CHI::Test module Requires: perl-CHI = %{version}-%{release} @@ -104,22 +108,23 @@ CHI::Test and CHI::t perl modules %prep %setup -q -n CHI-%{version} %patch0 -p1 +%patch1 -p1 # Fix bogus permissions find lib \( -type f -a -executable \) -exec chmod -x {} \; %build %{__perl} Makefile.PL INSTALLDIRS=vendor --skipdeps NO_PACKLIST=1 -make %{?_smp_mflags} +%{__make} %{?_smp_mflags} %install -make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT +%{__make} pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \; %{_fixperms} $RPM_BUILD_ROOT/* %check -make test %{?with_author_tests:AUTHOR_TESTING=1} %{?with_smoke_tests:AUTOMATED_TESTING=1} +%{__make} test %{?with_author_tests:AUTHOR_TESTING=1} %{?with_smoke_tests:AUTOMATED_TESTING=1} %files %doc Changes @@ -142,6 +147,11 @@ make test %{?with_author_tests:AUTHOR_TESTING=1} %{?with_smoke_tests:AUTOMATED_T %{perl_vendorlib}/CHI/Test* %changelog +* Thu Jun 15 2017 Ralf Corsépius <corse...@fedoraproject.org> - 0.60-12 +- Add perl-CHI-0.60-Adapt-to-changes-in-Cache-FastMmap-1.45.patch + (https://bugzilla.redhat.com/attachment.cgi?id=1275936, RHBZ#1435166). +- Modernize spec. + * Tue Jun 06 2017 Jitka Plesnikova <jples...@redhat.com> - 0.60-11 - Perl 5.26 rebuild -- cgit v1.1 https://src.fedoraproject.org/cgit/perl-CHI.git/commit/?h=f26&id=017447fe537260bd04ccb6c8c1ee9366160d5994 _______________________________________________ perl-devel mailing list -- perl-devel@lists.fedoraproject.org To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org