[perl-MooseX-AttributeHelpers] Perl 5.18 compatibility

Petr Pisar ppisar at fedoraproject.org
Fri Aug 2 17:16:41 UTC 2013


commit 5df0723d42cbeb1e4bf12bb83e67d4975750ec4b
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Aug 2 19:14:42 2013 +0200

    Perl 5.18 compatibility

 ...23-Fix-tests-to-cope-radnomized-hash-keys.patch |   55 ++++++++++++++++++++
 perl-MooseX-AttributeHelpers.spec                  |    4 ++
 2 files changed, 59 insertions(+), 0 deletions(-)
---
diff --git a/MooseX-AttributeHelpers-0.23-Fix-tests-to-cope-radnomized-hash-keys.patch b/MooseX-AttributeHelpers-0.23-Fix-tests-to-cope-radnomized-hash-keys.patch
new file mode 100644
index 0000000..3a28e40
--- /dev/null
+++ b/MooseX-AttributeHelpers-0.23-Fix-tests-to-cope-radnomized-hash-keys.patch
@@ -0,0 +1,55 @@
+From 94d4ecede542aa0ae5e33e1aa68c6d9731bf295e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Fri, 2 Aug 2013 19:09:45 +0200
+Subject: [PATCH] Fix tests to cope radnomized hash keys
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Similar patch is in Moose.
+
+<https://rt.cpan.org/Public/Bug/Display.html?id=81564>
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ t/003_basic_hash.t | 4 ++--
+ t/203_trait_hash.t | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/t/003_basic_hash.t b/t/003_basic_hash.t
+index 1f842ae..c21ac52 100644
+--- a/t/003_basic_hash.t
++++ b/t/003_basic_hash.t
+@@ -170,10 +170,10 @@ is_deeply($options->provides, {
+ is($options->type_constraint->type_parameter, 'Str', '... got the right container type');
+ 
+ $stuff->set_option( oink => "blah", xxy => "flop" );
+-my @key_value = $stuff->key_value;
++my @key_value = sort{ $a->[0] cmp $b->[0] } $stuff->key_value;
+ is_deeply(
+     \@key_value,
+-    [ [ 'xxy', 'flop' ], [ 'quantity', 4 ], [ 'oink', 'blah' ] ],
++    [ sort{ $a->[0] cmp $b->[0] } [ 'xxy', 'flop' ], [ 'quantity', 4 ], [ 'oink', 'blah' ] ],
+     '... got the right key value pairs'
+ );
+ 
+diff --git a/t/203_trait_hash.t b/t/203_trait_hash.t
+index 8e876b1..451c0bb 100644
+--- a/t/203_trait_hash.t
++++ b/t/203_trait_hash.t
+@@ -156,10 +156,10 @@ is_deeply($options->provides, {
+ is($options->type_constraint->type_parameter, 'Str', '... got the right container type');
+ 
+ $stuff->set_option( oink => "blah", xxy => "flop" );
+-my @key_value = $stuff->key_value;
++my @key_value = sort{ $a->[0] cmp $b->[0] } $stuff->key_value;
+ is_deeply(
+     \@key_value,
+-    [ [ 'xxy', 'flop' ], [ 'quantity', 4 ], [ 'oink', 'blah' ] ],
++    [ sort{ $a->[0] cmp $b->[0] } [ 'xxy', 'flop' ], [ 'quantity', 4 ], [ 'oink', 'blah' ] ],
+     '... got the right key value pairs'
+ );
+ 
+-- 
+1.8.1.4
+
diff --git a/perl-MooseX-AttributeHelpers.spec b/perl-MooseX-AttributeHelpers.spec
index 5eafba0..6f0ff7e 100644
--- a/perl-MooseX-AttributeHelpers.spec
+++ b/perl-MooseX-AttributeHelpers.spec
@@ -6,6 +6,8 @@ License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/MooseX-AttributeHelpers/
 Source0:        http://search.cpan.org/CPAN/authors/id/D/DR/DROLSKY/MooseX-AttributeHelpers-%{version}.tar.gz
+# Perl 5.18 compatibility, CPAN RT#81564
+Patch0:         MooseX-AttributeHelpers-0.23-Fix-tests-to-cope-radnomized-hash-keys.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@@ -26,6 +28,7 @@ used attribute helper methods for more specific types of data.
 
 %prep
 %setup -q -n MooseX-AttributeHelpers-%{version}
+%patch0 -p1
 
 # first filter out the bits in _docdir...
 cat << \EOF > %{name}-prov
@@ -66,6 +69,7 @@ rm -rf %{buildroot}
 %changelog
 * Fri Aug 02 2013 Petr Pisar <ppisar at redhat.com> - 0.23-10
 - Perl 5.18 rebuild
+- Perl 5.18 compatibility (CPAN RT#81564)
 
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.23-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild



More information about the perl-devel mailing list