[libxml-autowriter-perl] 01/04: Fix deprecation warnings about UNIVERSAL::import. Patch by brian m. carlson. (Closes: #614874)
Niko Tyni
ntyni at moszumanska.debian.org
Wed Sep 17 20:50:08 UTC 2014
This is an automated email from the git hooks/post-receive script.
ntyni pushed a commit to branch master
in repository libxml-autowriter-perl.
commit 59f223e1d6352fc5f18fe43a23daa353a8d6bd2e
Author: Niko Tyni <ntyni at debian.org>
Date: Wed Sep 17 23:37:48 2014 +0300
Fix deprecation warnings about UNIVERSAL::import. Patch by brian m. carlson. (Closes: #614874)
---
debian/patches/series | 1 +
debian/patches/universal-import.patch | 155 ++++++++++++++++++++++++++++++++++
2 files changed, 156 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
index 3c61a4d..18c086a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
pod-warnings.patch
auto_set_repository.patch
pod-spelling.patch
+universal-import.patch
diff --git a/debian/patches/universal-import.patch b/debian/patches/universal-import.patch
new file mode 100644
index 0000000..58e800b
--- /dev/null
+++ b/debian/patches/universal-import.patch
@@ -0,0 +1,155 @@
+From 617c86741a3f3f6b8b03b8b4634e3a42f2a28123 Mon Sep 17 00:00:00 2001
+From: "brian m. carlson" <sandals at crustytoothpaste.net>
+Date: Sun, 9 Dec 2012 14:19:51 +0000
+Subject: [PATCH] Fix uses of UNIVERSAL->import.
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=85991
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614874
+
+This patch removes all use statements for UNIVERSAL and changes the code to use
+the method call syntax instead, using eval where necessary.
+---
+ lib/XML/Doctype/ElementDecl.pm | 1 -
+ lib/XML/ValidWriter.pm | 7 +++----
+ t/auto.t | 3 +--
+ t/cm_re.t | 3 +--
+ t/dtd.t | 1 -
+ t/escape.t | 1 -
+ t/foo.t | 1 -
+ t/valid.t | 3 +--
+ 8 files changed, 6 insertions(+), 14 deletions(-)
+
+--- libxml-autowriter-perl.orig/lib/XML/Doctype/ElementDecl.pm
++++ libxml-autowriter-perl/lib/XML/Doctype/ElementDecl.pm
+@@ -37,7 +37,6 @@
+ ) ;
+
+ use Carp ;
+-use UNIVERSAL qw( isa ) ;
+
+ $VERSION = 0.1 ;
+
+--- libxml-autowriter-perl.orig/lib/XML/ValidWriter.pm
++++ libxml-autowriter-perl/lib/XML/ValidWriter.pm
+@@ -265,7 +265,6 @@
+ 'WAS_END_TAG', # Set if last thing emitted was an empty tag or an end tag
+ 'STRAGGLERS', # '>' if we just emitted a start tag, ']]>' if <![CDATA[
+ ) ;
+-use UNIVERSAL qw( isa ) ;
+
+ use Carp ;
+
+@@ -344,7 +343,7 @@
+ ## If it's a reference to anything but a plain old hash, then the
+ ## first param is either an XML::ValidWriter, a reference to a glob
+ ## a reference to a SCALAR, or a reference to an IO::Handle.
+- return shift if ( @_ && ref $_[0] && isa( $_[0], 'XML::ValidWriter' ) ) ;
++ return shift if ( @_ && ref $_[0] && eval { $_[0]->isa( 'XML::ValidWriter' ) } ) ;
+ my $callpkg = caller(1) ;
+ croak "No default XML::ValidWriter declared for package '$callpkg'"
+ unless $pkg_writers{$callpkg} ;
+@@ -433,7 +432,7 @@
+ ## Find the original caller
+ my $caller_depth = 1 ;
+ ++$caller_depth
+- while caller && isa( scalar( caller $caller_depth ), __PACKAGE__ ) ;
++ while caller && eval { scalar( caller $caller_depth )->isa( __PACKAGE__ ) } ;
+ $self->{CREATED_AT} = join( ', ', (caller( $caller_depth ))[1,2] );
+ $self->reset ;
+
+@@ -1535,7 +1534,7 @@
+
+ sub AUTOLOAD {
+ croak "Function $AUTOLOAD not AUTOLOADable (no functions are)"
+- unless isa( $_[0], __PACKAGE__ ) ;
++ unless eval { $_[0]->isa( __PACKAGE__ ) };
+
+ my XML::ValidWriter $self = $_[0] ;
+ unless ( exists $self->{METHODS}->{$AUTOLOAD} ) {
+--- libxml-autowriter-perl.orig/t/auto.t
++++ libxml-autowriter-perl/t/auto.t
+@@ -15,7 +15,6 @@
+ use IO::File;
+ use Test ;
+ use XML::Doctype ;
+-use UNIVERSAL qw( isa ) ;
+
+ my $w ;
+ my $doctype ;
+@@ -324,7 +323,7 @@
+ ##
+ sub {
+ $w = XML::AutoWriter->new() ;
+- ok( isa( $w, "XML::AutoWriter" ) ) ;
++ ok( eval { $w->isa( "XML::AutoWriter" ) } ) ;
+ },
+
+ ) ;
+--- libxml-autowriter-perl.orig/t/cm_re.t
++++ libxml-autowriter-perl/t/cm_re.t
+@@ -14,7 +14,6 @@
+ use strict ;
+ use Test ;
+ use XML::Doctype ;
+-use UNIVERSAL qw( isa ) ;
+
+ my $dt ;
+ my $re ;
+@@ -28,7 +27,7 @@
+ <!ELEMENT c (#PCDATA|a|b|c)* >
+ TOHERE
+
+- ok( isa( $dt, 'XML::Doctype' ) ) ;
++ ok( eval { $dt->isa( 'XML::Doctype' ) } ) ;
+ },
+
+ sub { ok( eval { qr/^$dt->{ELTS}->{b}->{CONTENT}$/ } ) },
+--- libxml-autowriter-perl.orig/t/dtd.t
++++ libxml-autowriter-perl/t/dtd.t
+@@ -8,7 +8,6 @@
+
+ use strict ;
+ use Test ;
+-use UNIVERSAL qw( isa ) ;
+
+ use XML::Doctype;
+
+--- libxml-autowriter-perl.orig/t/escape.t
++++ libxml-autowriter-perl/t/escape.t
+@@ -14,7 +14,6 @@
+ use strict ;
+ use Test ;
+ use XML::Doctype ;
+-use UNIVERSAL qw( isa ) ;
+
+ my $w ;
+ my $doctype ;
+--- libxml-autowriter-perl.orig/t/foo.t
++++ libxml-autowriter-perl/t/foo.t
+@@ -14,7 +14,6 @@
+ use strict ;
+ use Test ;
+ use XML::Doctype ;
+-use UNIVERSAL qw( isa ) ;
+
+ my $w ;
+ my $doctype ;
+--- libxml-autowriter-perl.orig/t/valid.t
++++ libxml-autowriter-perl/t/valid.t
+@@ -14,7 +14,6 @@
+ use strict ;
+ use Test ;
+ use XML::Doctype ;
+-use UNIVERSAL qw( isa ) ;
+ use IO::File;
+
+ my $w ;
+@@ -296,7 +295,7 @@
+ ##
+ sub {
+ $w = XML::ValidWriter->new() ;
+- ok( isa( $w, "XML::ValidWriter" ) ) ;
++ ok( eval { $w->isa( "XML::ValidWriter" ) } ) ;
+ },
+
+ ) ;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libxml-autowriter-perl.git
More information about the Pkg-perl-cvs-commits
mailing list