r2071 - in packages/libxml-filter-sort-perl/trunk: . debian lib/XML/Filter lib/XML/Filter/Sort t

Niko Tyni ntyni-guest at costa.debian.org
Thu Feb 2 19:20:22 UTC 2006


Author: ntyni-guest
Date: 2006-02-02 19:20:22 +0000 (Thu, 02 Feb 2006)
New Revision: 2071

Added:
   packages/libxml-filter-sort-perl/trunk/META.yml
Modified:
   packages/libxml-filter-sort-perl/trunk/Changes
   packages/libxml-filter-sort-perl/trunk/MANIFEST
   packages/libxml-filter-sort-perl/trunk/README
   packages/libxml-filter-sort-perl/trunk/debian/changelog
   packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort.pm
   packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort/Buffer.pm
   packages/libxml-filter-sort-perl/trunk/t/1_buffer.t
   packages/libxml-filter-sort-perl/trunk/t/4_workout.t
Log:
svn-upgrade to 1.01


Modified: packages/libxml-filter-sort-perl/trunk/Changes
===================================================================
--- packages/libxml-filter-sort-perl/trunk/Changes	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/Changes	2006-02-02 19:20:22 UTC (rev 2071)
@@ -1,13 +1,20 @@
 Revision history for Perl extension XML::Filter::Sort.
 
+1.01  21-Apr-2005
+        - Fixed similar serious bug with text content of sort key was '0',
+          also reported by Rishi Dhupar
+
+1.00  20-Apr-2005
+        - Fixed serious bug with text content = '0' reported by Rishi Dhupar
+
 0.91  11-Jun-2002
-	- CPAN release
-	- imported into CVS on SourceForge
+        - CPAN release
+        - imported into CVS on SourceForge
 
 0.90  11-Jun-2002
-	- pre-CPAN release
+        - pre-CPAN release
 
 0.01  11-Apr-2002
-	- original version; created by h2xs 1.20 with options
-		-AX -n XML::Filter::Sort
+        - original version; created by h2xs 1.20 with options
+                -AX -n XML::Filter::Sort
 

Modified: packages/libxml-filter-sort-perl/trunk/MANIFEST
===================================================================
--- packages/libxml-filter-sort-perl/trunk/MANIFEST	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/MANIFEST	2006-02-02 19:20:22 UTC (rev 2071)
@@ -15,3 +15,4 @@
 t/4_workout.t
 t/5_diskbuffer.t
 t/6_diskworkout.t
+META.yml                                 Module meta-data (added by MakeMaker)

Copied: packages/libxml-filter-sort-perl/trunk/META.yml (from rev 2070, packages/libxml-filter-sort-perl/branches/upstream/current/META.yml)

Modified: packages/libxml-filter-sort-perl/trunk/README
===================================================================
--- packages/libxml-filter-sort-perl/trunk/README	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/README	2006-02-02 19:20:22 UTC (rev 2071)
@@ -23,14 +23,9 @@
       make install
 
 
-RELEASE HISTORY
-
-  Version 0.91 is the first release to CPAN
-
-
 COPYRIGHT
 
-  Copyright 2002 Grant McLean <grantm at cpan.org>
+  Copyright 2002-2005 Grant McLean <grantm at cpan.org>
 
   This library is free software; you can redistribute it and/or modify
   it under the same terms as Perl itself.

Modified: packages/libxml-filter-sort-perl/trunk/debian/changelog
===================================================================
--- packages/libxml-filter-sort-perl/trunk/debian/changelog	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/debian/changelog	2006-02-02 19:20:22 UTC (rev 2071)
@@ -1,3 +1,9 @@
+libxml-filter-sort-perl (1.01-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Niko Tyni <ntyni at iki.fi>  Thu,  2 Feb 2006 21:19:38 +0200
+
 libxml-filter-sort-perl (0.91-1) unstable; urgency=low
 
   * Initial Release (Closes: #204091).

Modified: packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort/Buffer.pm
===================================================================
--- packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort/Buffer.pm	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort/Buffer.pm	2006-02-02 19:20:22 UTC (rev 2071)
@@ -1,4 +1,4 @@
-# $Id: Buffer.pm,v 1.1.1.1 2002/06/14 20:40:11 grantm Exp $
+# $Id: Buffer.pm,v 1.2 2005/04/20 20:04:34 grantm Exp $
 
 package XML::Filter::Sort::Buffer;
 
@@ -187,7 +187,8 @@
 
   my $text = '';
 
-  while(my $node = shift) {
+  while(@_) {
+    my $node = shift;
     if(ref($node)) {
       if($node->[NODE_TYPE] eq 'e') {
 	if(@{$node->[NODE_CONTENT]}) {
@@ -238,7 +239,8 @@
 
   @_ = @{$self->{tree}} unless(@_);
 
-  while(my $node = shift) {
+  while(@_) {
+    my $node = shift;
     if(ref($node)) {
       if($node->[NODE_TYPE] eq 'e') {
 	$filter->start_element($node->[NODE_DATA]);

Modified: packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort.pm
===================================================================
--- packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort.pm	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/lib/XML/Filter/Sort.pm	2006-02-02 19:20:22 UTC (rev 2071)
@@ -1,5 +1,3 @@
-# $Id: Sort.pm,v 1.1.1.1 2002/06/14 20:40:02 grantm Exp $
-
 package XML::Filter::Sort;
 
 use strict;
@@ -14,7 +12,7 @@
 
 use vars qw($VERSION @ISA);
 
-$VERSION = '0.91';
+$VERSION = '1.01';
 
 @ISA = qw(XML::SAX::Base);
 
@@ -455,7 +453,7 @@
 sub send_characters {
   my $self    = shift;
 
-  return unless($self->{char_buffer});
+  return unless(exists $self->{char_buffer});
   if($self->{buffer}) {
     $self->{buffer}->characters({Data => $self->{char_buffer}});
   }
@@ -822,7 +820,7 @@
 
 =head1 COPYRIGHT 
 
-Copyright 2002 Grant McLean E<lt>grantm at cpan.orgE<gt>
+Copyright 2002-2005 Grant McLean E<lt>grantm at cpan.orgE<gt>
 
 This library is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself. 

Modified: packages/libxml-filter-sort-perl/trunk/t/1_buffer.t
===================================================================
--- packages/libxml-filter-sort-perl/trunk/t/1_buffer.t	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/t/1_buffer.t	2006-02-02 19:20:22 UTC (rev 2071)
@@ -1,4 +1,4 @@
-# $Id: 1_buffer.t,v 1.1.1.1 2002/06/14 20:39:55 grantm Exp $
+# $Id: 1_buffer.t,v 1.2 2005/04/20 20:03:52 grantm Exp $
 
 use strict;
 use Test::More;
@@ -143,6 +143,7 @@
   <lastname>Boozle</lastname>
   <age unit='year'>35</age>
   <empty />
+  <zero>0</zero>
 </person>);
 
 my(@keyvals);

Modified: packages/libxml-filter-sort-perl/trunk/t/4_workout.t
===================================================================
--- packages/libxml-filter-sort-perl/trunk/t/4_workout.t	2006-02-02 19:19:31 UTC (rev 2070)
+++ packages/libxml-filter-sort-perl/trunk/t/4_workout.t	2006-02-02 19:20:22 UTC (rev 2071)
@@ -1,4 +1,4 @@
-# $Id: 4_workout.t,v 1.1.1.1 2002/06/14 20:39:48 grantm Exp $
+# $Id: 4_workout.t,v 1.3 2005/04/20 20:03:53 grantm Exp $
 
 use strict;
 use Test::More;
@@ -19,7 +19,7 @@
 
 }
 
-plan tests => 25;
+plan tests => 26;
 
 use XML::Filter::Sort;
 use XML::SAX::Machines qw( :all );
@@ -97,6 +97,7 @@
   <snackfood>popcorn</snackfood>
   <person>3<firstname>Wayne</firstname></person>
   <person>4<firstname>Xavier</firstname></person>
+  <trailer>0</trailer>
 </list>);
 
 $xmlout = '';
@@ -117,6 +118,7 @@
   <snackfood>popcorn</snackfood>
   <person>3<firstname>Wayne</firstname></person>
   <person>4<firstname>Xavier</firstname></person>
+  <trailer>0</trailer>
 </list>), 'Sorted two independent lists (element between)');
 
 
@@ -947,6 +949,41 @@
 
 
 ##############################################################################
+# Test that text content of '0' doesn't give us grief (any more).
+#
+
+$xmlin = q(<list>
+  <prefix>0</prefix>
+  <item>9</item>
+  <item>5</item>
+  <item>0</item>
+  <item>7</item>
+  <suffix>0</suffix>
+</list>);
+
+$xmlout = '';
+
+ at opts = (Record => 'item', Keys => '., num, asc');
+push @opts, @main::TempOpts;
+
+$sorter = Pipeline(
+  XML::Filter::Sort->new(@opts) => \$xmlout
+);
+$sorter->parse_string($xmlin);
+fix_xml($xmlout);
+
+is($xmlout, q(<list>
+  <prefix>0</prefix>
+  <item>0</item>
+  <item>5</item>
+  <item>7</item>
+  <item>9</item>
+  <suffix>0</suffix>
+</list>), 'No problem with text content of "0" even in sort key');
+
+
+
+##############################################################################
 #                       S U B R O U T I N E S
 ##############################################################################
 




More information about the Pkg-perl-cvs-commits mailing list