diff options
author | seb <seb@pkgsrc.org> | 2007-08-06 15:28:03 +0000 |
---|---|---|
committer | seb <seb@pkgsrc.org> | 2007-08-06 15:28:03 +0000 |
commit | e8f1f23ee636855a06543cfd6019c215c51d0364 (patch) | |
tree | f747455534902f3ac7f2aee38a2cd4ebe3e4a078 | |
parent | 78e51b56caf95022e2d76f3b0cd3bcd62b3d1115 (diff) | |
download | pkgsrc-e8f1f23ee636855a06543cfd6019c215c51d0364.tar.gz |
Fix a bug in XML::LibXML::NodeList::Iterator::last().
Patches sent upstream.
Bump PKGREVISION to 1.
-rw-r--r-- | textproc/p5-XML-LibXML-Iterator/Makefile | 3 | ||||
-rw-r--r-- | textproc/p5-XML-LibXML-Iterator/distinfo | 4 | ||||
-rw-r--r-- | textproc/p5-XML-LibXML-Iterator/patches/patch-aa | 13 | ||||
-rw-r--r-- | textproc/p5-XML-LibXML-Iterator/patches/patch-ab | 63 |
4 files changed, 81 insertions, 2 deletions
diff --git a/textproc/p5-XML-LibXML-Iterator/Makefile b/textproc/p5-XML-LibXML-Iterator/Makefile index 32120abc2c3..6d9c1020998 100644 --- a/textproc/p5-XML-LibXML-Iterator/Makefile +++ b/textproc/p5-XML-LibXML-Iterator/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.9 2007/07/19 21:55:50 seb Exp $ +# $NetBSD: Makefile,v 1.10 2007/08/06 15:28:03 seb Exp $ # DISTNAME= XML-LibXML-Iterator-1.02 +PKGREVISION= 1 PKGNAME= p5-${DISTNAME} SVR4_PKGNAME= p5xlx CATEGORIES= textproc perl5 diff --git a/textproc/p5-XML-LibXML-Iterator/distinfo b/textproc/p5-XML-LibXML-Iterator/distinfo index cf9f8595c80..86a99862713 100644 --- a/textproc/p5-XML-LibXML-Iterator/distinfo +++ b/textproc/p5-XML-LibXML-Iterator/distinfo @@ -1,5 +1,7 @@ -$NetBSD: distinfo,v 1.3 2007/07/19 21:55:51 seb Exp $ +$NetBSD: distinfo,v 1.4 2007/08/06 15:28:03 seb Exp $ SHA1 (XML-LibXML-Iterator-1.02.tar.gz) = cb41b80d22b0c5ee5de61abeb5a866b349b96966 RMD160 (XML-LibXML-Iterator-1.02.tar.gz) = a1f003fd89a20693f3b989b77ec0ad77dc75cd7e Size (XML-LibXML-Iterator-1.02.tar.gz) = 7712 bytes +SHA1 (patch-aa) = 114cec249ab35eed749037e7ad33811fcb077a42 +SHA1 (patch-ab) = b8330c8a1b30e99311bebf19c15f5f3bf29a4672 diff --git a/textproc/p5-XML-LibXML-Iterator/patches/patch-aa b/textproc/p5-XML-LibXML-Iterator/patches/patch-aa new file mode 100644 index 00000000000..acdac4db99c --- /dev/null +++ b/textproc/p5-XML-LibXML-Iterator/patches/patch-aa @@ -0,0 +1,13 @@ +$NetBSD: patch-aa,v 1.1 2007/08/06 15:28:03 seb Exp $ + +--- lib/XML/LibXML/NodeList/Iterator.pm.orig 2007-06-23 13:42:16.000000000 +0000 ++++ lib/XML/LibXML/NodeList/Iterator.pm +@@ -61,7 +61,7 @@ sub first { $_[0][1]=0; + sub last { + my $i = scalar(@{$_[0][0]})-1; + while($i >= 0){ +- if ( $_[0]->accept_node($_[0][0][$i] == FILTER_ACCEPT) ) { ++ if ( $_[0]->accept_node($_[0][0][$i]) == FILTER_ACCEPT ) { + $_[0][1] = $i; + last; + } diff --git a/textproc/p5-XML-LibXML-Iterator/patches/patch-ab b/textproc/p5-XML-LibXML-Iterator/patches/patch-ab new file mode 100644 index 00000000000..c431bb80d93 --- /dev/null +++ b/textproc/p5-XML-LibXML-Iterator/patches/patch-ab @@ -0,0 +1,63 @@ +$NetBSD: patch-ab,v 1.1 2007/08/06 15:28:04 seb Exp $ + +--- t/03list.t.orig 2007-06-23 13:33:50.000000000 +0000 ++++ t/03list.t +@@ -1,7 +1,7 @@ + use Test; + + +-BEGIN { plan tests => 7; } ++BEGIN { plan tests => 8; } + + use XML::LibXML; + use XML::LibXML::NodeList::Iterator; +@@ -257,3 +257,49 @@ sub t05_run_iterate { + return 1; + } + ok(t05_run_iterate()); ++ ++package MyFilter; ++use base qw(XML::NodeFilter); ++use XML::NodeFilter qw(:results); ++use UNIVERSAL; ++ ++sub accept_node { ++ my $self = shift; ++ my $node = shift; ++ if (!UNIVERSAL::isa($node, 'XML::LibXML::Element')) { ++ die "invalid node in MyFilter::accept_node()"; ++ } ++ return FILTER_DECLINED; ++} ++ ++package main; ++ ++sub t08_last_with_filter { ++ my $doc = XML::LibXML->new->parse_string( $xmlstr ); ++ ++ unless ( defined $doc ) { ++ print "# XML string was not parsed properly\n"; ++ return 0; ++ } ++ ++ my $nodelist = $doc->findnodes( '//*' ); ++ my $iterator = XML::LibXML::NodeList::Iterator->new( $nodelist ); ++ $iterator->add_filter( MyFilter->new() ); ++ ++ $iterator->last(); ++ ++ unless ( defined $iterator->current() ) { ++ print "# there is no last node\n"; ++ return 0; ++ } ++ ++ unless ( $iterator->current()->nodeName() eq "D" ) { ++ print "# expected nodeName 'D' received '" ++ . $iterator->current()->nodeName() ++ . "'\n"; ++ return 0; ++ } ++ ++ return 1; ++} ++ok(t08_last_with_filter()); |