[perl-Devel-EnforceEncapsulation] Fix for Perl 5.18 compatibility

Paul Howarth pghmcfc at fedoraproject.org
Wed Jul 17 13:35:27 UTC 2013


commit b2536965811b114588e6d4289284486b6a791369
Author: Paul Howarth <paul at city-fan.org>
Date:   Wed Jul 17 14:34:21 2013 +0100

    Fix for Perl 5.18 compatibility
    
    - Fix for change in overload behavior in Perl 5.17 onwards (CPAN RT#77486)
    - Don't need to remove empty directories from the buildroot
    - Drop %defattr, redundant since rpm 4.4

 Devel-EnforceEncapsulation-0.50-rt77486.patch |   31 +++++++++++++++++++++++++
 perl-Devel-EnforceEncapsulation.spec          |   13 ++++++++--
 2 files changed, 41 insertions(+), 3 deletions(-)
---
diff --git a/Devel-EnforceEncapsulation-0.50-rt77486.patch b/Devel-EnforceEncapsulation-0.50-rt77486.patch
new file mode 100644
index 0000000..4a153ef
--- /dev/null
+++ b/Devel-EnforceEncapsulation-0.50-rt77486.patch
@@ -0,0 +1,31 @@
+--- t/api.old	2006-10-11 09:55:54.000000000 -0400
++++ t/api.t	2012-05-27 19:24:50.000000000 -0400
+@@ -26,7 +26,12 @@
+    is $o->{secret}, 1, 'Unencapsulated classes are not affected';
+ 
+    Devel::EnforceEncapsulation->apply_to('Hash_class');
+-   is $o->{secret}, 1, 'Unencapsulated instances are still not affected';
++   if ( $] >= 5.017 ) {
++       eval { my $val = $o->{secret}; };
++       ok $@, 'Previously-unencapsulated instances are now encapsulated';
++   } else {
++       is $o->{secret}, 1, 'Unencapsulated instances are still not affected';
++   }
+ 
+    $o = Hash_class->new;
+    $o->foo(2);
+@@ -51,8 +56,12 @@
+    ok $@, 'Cannot reach into objects';
+ 
+    Devel::EnforceEncapsulation->remove_from('Hash_class');
+-   eval { my $val = $o->{secret};  $val = $s->{secret}; };
+-   ok $@, 'Still cannot reach into runtime injected objects';
++   if ( $] >= 5.017 ) {
++       is $o->{secret}, 2, 'Encapsulated instances now unencapsulated';
++   } else {
++       eval { my $val = $o->{secret};  $val = $s->{secret}; };
++       ok $@, 'Still cannot reach into runtime injected objects';
++   }
+ 
+    $o = Hash_class->new;
+    $o->foo(3);
diff --git a/perl-Devel-EnforceEncapsulation.spec b/perl-Devel-EnforceEncapsulation.spec
index 1827e15..1947c8f 100644
--- a/perl-Devel-EnforceEncapsulation.spec
+++ b/perl-Devel-EnforceEncapsulation.spec
@@ -1,11 +1,12 @@
 Name:		perl-Devel-EnforceEncapsulation
 Version:	0.50
-Release:	8%{?dist}
+Release:	9%{?dist}
 Summary:	Find access violations to blessed objects
 Group:		Development/Libraries
 License:	GPL+ or Artistic
 URL:		http://search.cpan.org/dist/Devel-EnforceEncapsulation/
 Source0:	http://search.cpan.org/CPAN/authors/id/C/CL/CLOTHO/Devel-EnforceEncapsulation-%{version}.tgz
+Patch0:		Devel-EnforceEncapsulation-0.50-rt77486.patch
 BuildArch:	noarch
 BuildRequires:	perl(Carp)
 BuildRequires:	perl(English)
@@ -46,6 +47,9 @@ life harder for downstream developers).
 %prep
 %setup -q -n Devel-EnforceEncapsulation-%{version}
 
+# Fix for change in overload behavior in Perl 5.17 onwards (CPAN RT#77486)
+%patch0
+
 %build
 perl Makefile.PL INSTALLDIRS=vendor
 make %{?_smp_mflags}
@@ -53,19 +57,22 @@ make %{?_smp_mflags}
 %install
 make pure_install DESTDIR=%{buildroot}
 find %{buildroot} -type f -name .packlist -exec rm -f {} \;
-find %{buildroot} -depth -type d -exec rmdir {} \; 2>/dev/null
 %{_fixperms} %{buildroot}
 
 %check
 make test AUTHOR_TEST=1 AUTHOR_TEST_CDOLAN=1
 
 %files
-%defattr(-,root,root,-)
 %doc CHANGES LICENSE README index.html
 %{perl_vendorlib}/Devel/
 %{_mandir}/man3/Devel::EnforceEncapsulation.3pm*
 
 %changelog
+* Wed Jul 17 2013 Paul Howarth <paul at city-fan.org> - 0.50-9
+- Fix for change in overload behavior in Perl 5.17 onwards (CPAN RT#77486)
+- Don't need to remove empty directories from the buildroot
+- Drop %%defattr, redundant since rpm 4.4
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.50-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list