Description: Fix compatibility with newer Encode versions
As of Encode 2.55 (commit
https://github.com/dankogai/p5-encode/commit/93b3d593d85004c570e44f3f79db0ca3c08d89ea
) Encode doesn't inherit from Exporter anymore, so
Encode->export_to_level() fails.
.
Replace the export_to_level() calls with Import::Into.
Origin: vendor
Bug:
https://rt.cpan.org/Public/Bug/Display.html?id=95975
Forwarded:
https://rt.cpan.org/Public/Bug/Display.html?id=95975
Bug-Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752928
Author: Niko Tyni <ntyni@debian.org>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2014-07-30
--- a/lib/Encode/Arabic.pm
+++ b/lib/Encode/Arabic.pm
@@ -8,6 +8,7 @@
our $VERSION = '1.9' || do { q $Revision: 808 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 };
+use Import::Into;
sub import { # perform import as if Encode were used one level before this module
@@ -25,7 +26,8 @@
require Encode;
- Encode->export_to_level(1, @_);
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_);
}
--- a/lib/Encode/Arabic/ArabTeX.pm
+++ b/lib/Encode/Arabic/ArabTeX.pm
@@ -14,6 +14,8 @@
use Scalar::Util 'blessed';
use Carp;
+use Import::Into;
+
our $VERSION = do { q $Revision: 717 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 };
@@ -107,7 +109,8 @@
require Encode;
- Encode->export_to_level(1, @_); # here comes the only trick ^^
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_); # here comes the only trick ^^
}
--- a/lib/Encode/Arabic/ArabTeX/RE.pm
+++ b/lib/Encode/Arabic/ArabTeX/RE.pm
@@ -12,6 +12,7 @@
use warnings;
use Scalar::Util 'blessed';
+use Import::Into;
our $VERSION = do { q $Revision: 162 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 };
@@ -49,7 +50,8 @@
sub import { # perform import as if Encode were used one level before this module
require Encode;
- Encode->export_to_level(1, @_);
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_);
}
--- a/lib/Encode/Arabic/ArabTeX/Verbatim.pm
+++ b/lib/Encode/Arabic/ArabTeX/Verbatim.pm
@@ -18,6 +18,7 @@
use Encode::Arabic::ArabTeX ();
use base 'Encode::Arabic::ArabTeX';
+use Import::Into;
use Encode::Encoding;
@@ -110,7 +111,8 @@
require Encode;
- Encode->export_to_level(1, @_); # here comes the only trick ^^
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_); # here comes the only trick ^^
}
--- a/lib/Encode/Arabic/ArabTeX/ZDMG.pm
+++ b/lib/Encode/Arabic/ArabTeX/ZDMG.pm
@@ -79,7 +79,8 @@
require Encode;
- Encode->export_to_level(1, @_); # here comes the only trick ^^
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_); # here comes the only trick ^^
}
--- a/lib/Encode/Arabic/ArabTeX/ZDMG/RE.pm
+++ b/lib/Encode/Arabic/ArabTeX/ZDMG/RE.pm
@@ -10,13 +10,15 @@
use strict;
use warnings;
+use Import::Into;
our $VERSION = do { q $Revision: 143 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 };
sub import { # perform import as if Encode were used one level before this module
require Encode;
- Encode->export_to_level(1, @_);
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_);
}
--- a/lib/Encode/Arabic/Buckwalter.pm
+++ b/lib/Encode/Arabic/Buckwalter.pm
@@ -12,6 +12,7 @@
use warnings;
use Scalar::Util 'blessed';
+use Import::Into;
our $VERSION = do { q $Revision: 179 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 };
@@ -66,7 +67,8 @@
require Encode;
- Encode->export_to_level(1, @_);
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_);
}
--- a/lib/Encode/Arabic/Parkinson.pm
+++ b/lib/Encode/Arabic/Parkinson.pm
@@ -12,6 +12,7 @@
use warnings;
use Scalar::Util 'blessed';
+use Import::Into;
our $VERSION = do { q $Revision: 179 $ =~ /(\d+)/; sprintf "%4.2f", $1 / 100 };
@@ -66,7 +67,8 @@
require Encode;
- Encode->export_to_level(1, @_);
+ shift @_; # no need for the package name
+ Encode->import::into(1, @_);
}
--- a/Build.PL
+++ b/Build.PL
@@ -10,6 +10,7 @@
dist_version_from => 'lib/Encode/Arabic.pm',
requires => {
'perl' => 5.008,
+ 'Import::Into' => 0,
},
build_requires => {
'Test::More' => 0,
--- a/META.yml
+++ b/META.yml
@@ -9,6 +9,7 @@
license:
http://dev.perl.org/licenses/
requires:
perl: 5.008
+ Import::Into: 0
build_requires:
Test::More: 0
provides: