From 5d99cdd3939b774e287aad0e6ce87a44f34958bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
Date: Thu, 22 Jun 2017 13:48:55 +0200
Subject: Fix "use parent q{Encode::Encoding}"

---
 ...e-2.90-Fix-importing-from-Encode-Encoding.patch | 54 ++++++++++++++++++++++
 perl-Encode.spec                                   |  8 +++-
 2 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 Encode-2.90-Fix-importing-from-Encode-Encoding.patch

diff --git a/Encode-2.90-Fix-importing-from-Encode-Encoding.patch 
b/Encode-2.90-Fix-importing-from-Encode-Encoding.patch
new file mode 100644
index 0000000..61153be
--- /dev/null
+++ b/Encode-2.90-Fix-importing-from-Encode-Encoding.patch
@@ -0,0 +1,54 @@
+From 82aef7a207f7cccf21026a766968515e53fc1a18 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
+Date: Thu, 22 Jun 2017 13:45:29 +0200
+Subject: [PATCH] Fix importing from Encode::Encoding
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Ported to 2.90:
+
+commit 208d094b8cf82da488495400ea9a518841fd007a
+Author: Dan Kogai <[email protected]>
+Date:   Thu Jun 22 17:05:01 2017 +0900
+
+    Addressed: https://rt.cpan.org/Ticket/Display.html?id=122167
+
+commit a2f702b28b5d93a96b83aff283575b5b155b50ac
+Author: Dan Kogai <[email protected]>
+Date:   Thu Jun 22 18:13:47 2017 +0900
+
+    Stop directory tweaking $Encode::Encoding{utf8}
+
+CPAN RT#122167
+
+Signed-off-by: Petr Písař <[email protected]>
+---
+ Encode.pm | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/Encode.pm b/Encode.pm
+index b0e9092..8813715 100644
+--- a/Encode.pm
++++ b/Encode.pm
+@@ -343,9 +343,14 @@ if ($ON_EBCDIC) {
+ {
+     package Encode::utf8;
+     use parent 'Encode::Encoding';
+-    __PACKAGE__->Define('utf8');
+-    my $strict_obj = bless { Name => "utf-8-strict", strict_utf8 => 1 } => 
"Encode::utf8";
+-    Encode::define_encoding($strict_obj, 'utf-8-strict');
++    my %obj = (
++        'utf8'         => { Name => 'utf8' },
++        'utf-8-strict' => { Name => 'utf-8-strict', strict_utf8 => 1 }
++    );
++    for ( keys %obj ) {
++        bless $obj{$_} => __PACKAGE__;
++        Encode::define_encoding( $obj{$_} => $_ );
++    }
+     sub cat_decode {
+         # ($obj, $dst, $src, $pos, $trm, $chk)
+         # currently ignores $chk
+-- 
+2.9.4
+
diff --git a/perl-Encode.spec b/perl-Encode.spec
index 8d6cd2a..c6db93f 100644
--- a/perl-Encode.spec
+++ b/perl-Encode.spec
@@ -8,7 +8,7 @@ Version:        %{cpan_version}
 # perl-encoding sub-package has independent version which does not change
 # often and consecutive builds would clash on perl-encoding NEVRA. This is the
 # same case as in perl.spec.
-Release:        9%{?dist}
+Release:        10%{?dist}
 Summary:        Character encodings in Perl
 # ucm:          UCD
 # bin/encguess: Artistic 2.0
@@ -16,6 +16,8 @@ Summary:        Character encodings in Perl
 License:        (GPL+ or Artistic) and Artistic 2.0 and UCD
 URL:            http://search.cpan.org/dist/Encode/
 Source0:        
http://www.cpan.org/authors/id/D/DA/DANKOGAI/Encode-%{cpan_version}.tar.gz
+# Fix "use parent q{Encode::Encoding}", CPAN RT#122167, in upstream after 2.90
+Patch0:         Encode-2.90-Fix-importing-from-Encode-Encoding.patch
 BuildRequires:  findutils
 BuildRequires:  gcc
 BuildRequires:  make
@@ -125,6 +127,7 @@ your own encoding to perl. No knowledge of XS is necessary.
 
 %prep
 %setup -q -n Encode-%{cpan_version}
+%patch0 -p1
 
 %build
 # Additional scripts can be installed by appending MORE_SCRIPTS, UCM files by
@@ -165,6 +168,9 @@ make test
 %{perl_vendorarch}/Encode/encode.h
 
 %changelog
+* Thu Jun 22 2017 Petr Pisar <[email protected]> - 4:2.90-10
+- Fix "use parent q{Encode::Encoding}" (CPAN RT#122167)
+
 * Mon Jun 12 2017 Petr Pisar <[email protected]> - 4:2.90-9
 - 2.90 bump
 
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-Encode.git/commit/?h=master&id=5d99cdd3939b774e287aad0e6ce87a44f34958bd
_______________________________________________
perl-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to