Hello community,

here is the log from the commit of package perl-XML-LibXSLT for 
openSUSE:Factory checked in at 2011-11-02 12:15:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-XML-LibXSLT (Old)
 and      /work/SRC/openSUSE:Factory/.perl-XML-LibXSLT.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-XML-LibXSLT", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-XML-LibXSLT/perl-XML-LibXSLT.changes        
2011-10-27 14:38:23.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-XML-LibXSLT.new/perl-XML-LibXSLT.changes   
2011-11-02 12:15:17.000000000 +0100
@@ -1,0 +2,11 @@
+Mon Oct 31 02:34:47 UTC 2011 - [email protected]
+
+- update to 1.75
+    - Convert the following test scripts from Test.pm to Test::More :
+        - t/03input.t
+    - Fix for https://rt.cpan.org/Public/Bug/Display.html?id=71345 by Tim
+    Brody:
+        - «segfault in free()»
+        - Thanks, Tim!
+
+-------------------------------------------------------------------

Old:
----
  XML-LibXSLT-1.74.tar.gz

New:
----
  XML-LibXSLT-1.75.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-XML-LibXSLT.spec ++++++
--- /var/tmp/diff_new_pack.htVMsM/_old  2011-11-02 12:15:19.000000000 +0100
+++ /var/tmp/diff_new_pack.htVMsM/_new  2011-11-02 12:15:19.000000000 +0100
@@ -18,7 +18,7 @@
 
 
 Name:           perl-XML-LibXSLT
-Version:        1.74
+Version:        1.75
 Release:        7
 License:        GPL-1.0+ or Artistic
 Summary:        XML::LibXSLT Perl Module

++++++ XML-LibXSLT-1.74.tar.gz -> XML-LibXSLT-1.75.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/Changes new/XML-LibXSLT-1.75/Changes
--- old/XML-LibXSLT-1.74/Changes        2011-10-25 21:48:58.000000000 +0200
+++ new/XML-LibXSLT-1.75/Changes        2011-10-28 17:27:07.000000000 +0200
@@ -1,5 +1,13 @@
 Revision history for Perl extension XML::LibXSLT.
 
+1.75            Fri Oct 28 17:26:57 IST 2011
+    - Convert the following test scripts from Test.pm to Test::More :
+        - t/03input.t
+    - Fix for https://rt.cpan.org/Public/Bug/Display.html?id=71345 by Tim
+    Brody:
+        - «segfault in free()»
+        - Thanks, Tim!
+
 1.74            Tue Oct 25 21:48:48 IST 2011
     - Convert the following test scripts from Test.pm to Test::More :
         - t/01basic.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/LibXSLT.pm 
new/XML-LibXSLT-1.75/LibXSLT.pm
--- old/XML-LibXSLT-1.74/LibXSLT.pm     2011-10-25 21:49:15.000000000 +0200
+++ new/XML-LibXSLT-1.75/LibXSLT.pm     2011-10-28 17:26:47.000000000 +0200
@@ -25,7 +25,7 @@
 
 require Exporter;
 
-$VERSION = "1.74";
+$VERSION = "1.75";
 
 require DynaLoader;
 
@@ -54,6 +54,7 @@
 # ido - perl dispatcher
 sub perl_dispatcher {
     my $func = shift;
+       my $owner_doc = shift;
     my @params = @_;
     my @perlParams;
     
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/LibXSLT.xs 
new/XML-LibXSLT-1.75/LibXSLT.xs
--- old/XML-LibXSLT-1.74/LibXSLT.xs     2011-10-19 19:34:26.000000000 +0200
+++ new/XML-LibXSLT-1.75/LibXSLT.xs     2011-10-28 17:15:52.000000000 +0200
@@ -224,6 +224,7 @@
 
 static void
 LibXSLT__function (xmlXPathParserContextPtr ctxt, int nargs, SV 
*perl_function) {
+       SV * owner_doc;
     xmlXPathObjectPtr obj,ret;
     xmlNodeSetPtr nodelist = NULL;
     int count;
@@ -247,6 +248,10 @@
     
     XPUSHs(perl_function);
 
+       /* clone all of the arguments into a new owning document */
+       owner_doc = x_PmmNodeToSv(INT2PTR(xmlNodePtr,xmlNewDoc("1.0")),NULL);
+       XPUSHs( sv_2mortal(owner_doc) );
+
     /* set up call to perl dispatcher function */
     for (i = 0; i < nargs; i++) {
         obj = (xmlXPathObjectPtr)valuePop(ctxt);
@@ -254,39 +259,35 @@
         case XPATH_NODESET:
         case XPATH_XSLT_TREE:
             nodelist = obj->nodesetval;
-            if ( nodelist ) {
-                XPUSHs(sv_2mortal(newSVpv("XML::LibXML::NodeList", 0)));       
                        
-                XPUSHs(sv_2mortal(newSViv(nodelist->nodeNr)));
-                if ( nodelist->nodeNr > 0 ) {
-                    int i = 0 ;
-                    const char * cls = "XML::LibXML::Node";
-                    xmlNodePtr tnode = NULL;
-                    SV * element = NULL;
-                    len = nodelist->nodeNr;
-                    for( ; i < len; i++ ){
-                        tnode = nodelist->nodeTab[i];
-                        if (tnode->type == XML_NAMESPACE_DECL) {
-                            element = sv_newmortal();
-                            cls = x_PmmNodeTypeName( tnode );
-                            element = sv_setref_pv( element,
-                                                    (const char *)cls,
-                                                    (void 
*)xmlCopyNamespace((xmlNsPtr)tnode)
-                                                );
-                       } else {
-                          /* need to copy the node as libxml2 will free it */
-                         xmlNodePtr tnode_cpy = xmlCopyNode(tnode, 1);
-                           if( tnode_cpy != NULL) {
-                             ProxyNodePtr owner = NULL;
-                             if ( tnode_cpy != NULL && tnode_cpy->doc != NULL) 
{
-                               owner = 
x_PmmOWNERPO(x_PmmNewNode(INT2PTR(xmlNodePtr,tnode_cpy->doc)));
-                             }
-                             element = x_PmmNodeToSv(tnode_cpy, owner);
-                           }
-                        }
-                        XPUSHs( sv_2mortal(element) );
-                    }
-                }
-            }
+                       if ( nodelist == NULL )
+                               break;
+                       XPUSHs(sv_2mortal(newSVpv("XML::LibXML::NodeList", 0)));
+                       XPUSHs(sv_2mortal(newSViv(nodelist->nodeNr)));
+                       if ( nodelist->nodeNr == 0 )
+                               break;
+                       const char * cls = "XML::LibXML::Node";
+                       xmlNodePtr tnode = NULL;
+                       SV * element = NULL;
+                       int i;
+                       for(i=0; i < nodelist->nodeNr; i++ ){
+                               tnode = nodelist->nodeTab[i];
+                               /* need to copy the node as libxml2 will free 
it */
+                               if (tnode->type == XML_NAMESPACE_DECL) {
+                                       element = sv_newmortal();
+                                       cls = x_PmmNodeTypeName( tnode );
+                                       element = sv_setref_pv( element,
+                                                       (const char *)cls,
+                                                       (void 
*)xmlCopyNamespace((xmlNsPtr)tnode)
+                                                       );
+                               }
+                               else {
+                                       xmlNodePtr tnode_cpy = 
xmlDocCopyNode(tnode,INT2PTR(xmlDocPtr,x_PmmNODE(SvPROXYNODE(owner_doc))),1);
+                                       if( tnode_cpy == NULL )
+                                               break;
+                                       element = 
x_PmmNodeToSv(tnode_cpy,SvPROXYNODE(owner_doc));
+                               }
+                               XPUSHs( sv_2mortal(element) );
+                       }
             break;
         case XPATH_BOOLEAN:
             XPUSHs(sv_2mortal(newSVpv("XML::LibXML::Boolean", 0)));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/MANIFEST 
new/XML-LibXSLT-1.75/MANIFEST
--- old/XML-LibXSLT-1.74/MANIFEST       2011-10-25 21:49:50.000000000 +0200
+++ new/XML-LibXSLT-1.75/MANIFEST       2011-10-28 17:28:00.000000000 +0200
@@ -1,8 +1,13 @@
-benchmark/benchmark.pl
+Changes
+LibXSLT.pm
+LibXSLT.xs
+MANIFEST
+Makefile.PL
+README
 benchmark/Driver/BaseClass.pm
 benchmark/Driver/LibXSLT.pm
 benchmark/Driver/Sablotron.pm
-Changes
+benchmark/benchmark.pl
 example/1.xml
 example/1.xsl
 example/2.xml
@@ -12,14 +17,9 @@
 example/bad3.xsl
 example/fatal.xsl
 example/nonfatal.xsl
-LibXSLT.pm
-LibXSLT.xs
-Makefile.PL
-MANIFEST
 perl-libxml-mm.c
 perl-libxml-mm.h
 ppport.h
-README
 t/01basic.t
 t/02dromeds.t
 t/03input.t
@@ -36,6 +36,8 @@
 t/13error.t
 t/14security.t
 t/15misc.t
+t/rt71345_a.t
+t/rt71345_b.t
 testcases/default.conf
 typemap
 META.yml                                 Module meta-data (added by MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/META.yml 
new/XML-LibXSLT-1.75/META.yml
--- old/XML-LibXSLT-1.74/META.yml       2011-10-25 21:49:50.000000000 +0200
+++ new/XML-LibXSLT-1.75/META.yml       2011-10-28 17:28:00.000000000 +0200
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               XML-LibXSLT
-version:            1.74
+version:            1.75
 abstract:           Interface to Gnome libxslt library
 author:
     - Matt Sergeant
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/t/03input.t 
new/XML-LibXSLT-1.75/t/03input.t
--- old/XML-LibXSLT-1.74/t/03input.t    2011-10-20 12:47:23.000000000 +0200
+++ new/XML-LibXSLT-1.75/t/03input.t    2011-10-26 13:02:04.000000000 +0200
@@ -1,22 +1,28 @@
-use Test;
-BEGIN { plan tests => 25 }
+use strict;
+use warnings;
+
+# Should be 25.
+use Test::More tests => 25;
 use XML::LibXSLT;
 use XML::LibXML 1.59;
 
 my $parser = XML::LibXML->new();
-print "# parser\n";
-ok($parser);
+# parser
+# TEST
+ok ($parser, 'Parser was initted.');
 
 my $doc = $parser->parse_string(<<'EOT');
 <xml>random contents</xml>
 EOT
 
-print "# doc\n";
-ok($doc);
+# doc
+# TEST
+ok ($doc, 'Doc was initted.');
 
 my $xslt = XML::LibXSLT->new();
-print "# xslt\n";
-ok($xslt);
+# xslt
+# TEST
+ok ($xslt, 'xslt was initted.');
 
 my $stylsheetstring = <<'EOT';
 <xsl:stylesheet version="1.0"
@@ -37,29 +43,32 @@
 EOT
 
 my $icb = XML::LibXML::InputCallback->new();
-ok($icb);
+# TEST
+ok ($icb, 'icb was initted.');
 
-print "# registering callbacks\n";
+# registering callbacks
 $icb->register_callbacks( [ \&match_cb, \&open_cb,
                             \&read_cb, \&close_cb ] );
 
 $xslt->input_callbacks($icb);
                 
 my $stylesheet = 
$xslt->parse_stylesheet($parser->parse_string($stylsheetstring));
-print "# stylesheet\n";
-ok($stylesheet);
+# stylesheet
+# TEST
+ok ($stylesheet, 'stylesheet is OK.');
 
 #$stylesheet->input_callbacks($icb);
 
 # warn "transforming\n";
 my $results = $stylesheet->transform($doc);
-print "# results\n";
-ok($results);
+# results
+# TEST
+ok ($results, 'results is OK.');
 
 my $output = $stylesheet->output_string($results);
 # warn "output: $output\n";
-print "# output\n";
-ok($output);
+# TEST
+ok ($output, 'output is OK.');
 
 # test a dying close callback
 # callbacks can only be registered as a callback group
@@ -69,15 +78,14 @@
 $stylesheet->close_callback( \&close_cb );
 
 # check if transform throws an exception
-print "# dying callback test\n";
+# dying callback test
 eval {
     $stylesheet->transform($doc);
 };
-if ($@) {
-    ok(1, 1, "Threw: $@");
-}
-else {
-    ok(0, 1, "No error");
+{
+    my $E = $@;
+    # TEST
+    ok ($E, "Threw: $E");
 }
 
 #
@@ -89,7 +97,7 @@
 $xslt = XML::LibXSLT->new();
 $stylesheet = $xslt->parse_stylesheet($parser->parse_string($stylsheetstring));
 
-print "# setting callbacks\n";
+# setting callbacks
 local $XML::LibXML::match_cb = \&match_cb;
 local $XML::LibXML::open_cb = \&open_cb;
 local $XML::LibXML::close_cb = \&close_cb;
@@ -98,14 +106,16 @@
 # warn "transform!\n";
 $results = $stylesheet->transform($doc);
 
-print "# results\n";
-ok($results);
+# results
+# TEST
+ok ($results, 'results is OK - 2.');
 
 $output = $stylesheet->output_string($results);
 
 # warn "output: $output\n";
-print "# output\n";
-ok($output);
+# output
+# TEST
+ok ($output, 'output is OK - 2.');
 
 $XML::LibXML::open_cb = \&dying_open_cb;
 
@@ -113,11 +123,10 @@
 eval {
     $stylesheet->transform($doc);
 };
-if ($@) {
-    ok(1, 1, "Threw: $@");
-}
-else {
-    ok(0, 1, "No error");
+{
+    my $E = $@;
+    # TEST
+    ok ($E, "Transform Threw: $E");
 }
 
 #
@@ -131,7 +140,7 @@
 $xslt = XML::LibXSLT->new();
 $icb = XML::LibXML::InputCallback->new();
 
-print "# registering callbacks\n";
+# registering callbacks
 $icb->register_callbacks( [ \&match_cb, \&stylesheet_open_cb,
                             \&read_cb, \&close_cb ] );
 
@@ -158,8 +167,9 @@
 EOT
 
 $stylesheet = $xslt->parse_stylesheet($parser->parse_string($stylsheetstring));
-print "# stylesheet\n";
-ok($stylesheet);
+# stylesheet
+# TEST
+ok ($stylesheet, 'stylesheet is OK - 2.');
 
 #
 # input callback functions
@@ -167,9 +177,10 @@
 
 sub match_cb {
     my $uri = shift;
-    print "# match_cb: $uri\n";
+    # match_cb
     if ($uri eq "foo.xml") {
-        ok(1);
+        # TEST*5
+        ok(1, 'URI is OK in match_cb.');
         return 1;
     }
     return 0;
@@ -177,35 +188,35 @@
 
 sub open_cb {
     my $uri = shift;
-    print "# open_cb: $uri\n";
-    ok($uri, "foo.xml");
+    # TEST*2
+    is ($uri, 'foo.xml', 'URI is OK in open_cb.');
     my $str ="<foo>Text here</foo>";
     return \$str;
 }
 
 sub dying_open_cb {
     my $uri = shift;
-    print "# dying_open_cb: $uri\n";
-    ok($uri, "foo.xml");
+    # dying_open_cb: $uri
+    # TEST*2
+    is ($uri, 'foo.xml', 'dying_open_cb');
     die "Test a die from open_cb";
 }
 
 sub stylesheet_open_cb {
     my $uri = shift;
-    print "# open_cb: $uri\n";
-    ok($uri, "foo.xml");
+    # TEST
+    is ($uri, 'foo.xml', 'stylesheet_open_cb uri compare.');
     my $str = '<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>';
     return \$str;
 }
 
 sub close_cb {
-    print "# close_cb\n";
     # warn("close\n");
-    ok(1);
+    # TEST*3
+    ok(1, 'close_cb()');
 }
 
 sub read_cb {
-    print "# read_cb\n";
 #    warn("read\n");
     return substr(${$_[0]}, 0, $_[1], "");
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/t/rt71345_a.t 
new/XML-LibXSLT-1.75/t/rt71345_a.t
--- old/XML-LibXSLT-1.74/t/rt71345_a.t  1970-01-01 01:00:00.000000000 +0100
+++ new/XML-LibXSLT-1.75/t/rt71345_a.t  2011-10-28 17:24:40.000000000 +0200
@@ -0,0 +1,42 @@
+use Test::More tests => 2;
+
+# See:
+# https://rt.cpan.org/Ticket/Display.html?id=71345
+{
+use strict;
+use warnings;
+
+use XML::LibXSLT;
+use XML::LibXML;
+
+my $xslt = XML::LibXSLT->new();
+my $ext_uri = "urn:local";
+my @keep;
+XML::LibXSLT->register_function($ext_uri, "uc", sub { push @keep, @_; return 
uc shift; } );
+
+my $stylesheet = $xslt->parse_stylesheet(XML::LibXML->load_xml(string => 
<<'EOF'));
+<xsl:stylesheet version="1.0"
+                extension-element-prefixes="exsl local"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:exsl="http://exslt.org/common"; 
+                xmlns:local="urn:local">
+  <xsl:template match="/">
+    <xsl:variable name="foo"><foo a="foo"/></xsl:variable>
+    <bar><xsl:value-of select="local:uc(exsl:node-set($foo)//@a)"/></bar>
+  </xsl:template>
+</xsl:stylesheet>
+EOF
+
+my $input = XML::LibXML->load_xml(string => "<input/>");
+# TEST
+like ($stylesheet->transform($input)->toString,
+    qr{\Q<bar>FOO</bar>\E},
+    'transformation works.',
+);
+
+# Next line crashes Perl
+@keep = undef;
+
+}
+# TEST
+ok(1, 'Did not crash.');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-LibXSLT-1.74/t/rt71345_b.t 
new/XML-LibXSLT-1.75/t/rt71345_b.t
--- old/XML-LibXSLT-1.74/t/rt71345_b.t  1970-01-01 01:00:00.000000000 +0100
+++ new/XML-LibXSLT-1.75/t/rt71345_b.t  2011-10-28 17:25:28.000000000 +0200
@@ -0,0 +1,38 @@
+use Test::More tests => 2;
+
+# See:
+# https://rt.cpan.org/Ticket/Display.html?id=71345
+{
+use strict;
+use warnings;
+
+use XML::LibXSLT;
+use XML::LibXML;
+
+my $xslt = XML::LibXSLT->new();
+my $ext_uri = "urn:local";
+XML::LibXSLT->register_function($ext_uri, "uc", sub { return uc shift; } );
+
+my $stylesheet = $xslt->parse_stylesheet(XML::LibXML->load_xml(string => 
<<'EOF'));
+<xsl:stylesheet version="1.0"
+                extension-element-prefixes="exsl local"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                xmlns:exsl="http://exslt.org/common"; 
+                xmlns:local="urn:local">
+  <xsl:template match="/">
+    <xsl:variable name="foo"><foo a="foo"/></xsl:variable>
+    <bar><xsl:value-of select="local:uc(exsl:node-set($foo)//@a)"/></bar>
+  </xsl:template>
+</xsl:stylesheet>
+EOF
+
+my $input = XML::LibXML->load_xml(string => "<input/>");
+# TEST
+like ($stylesheet->transform($input)->toString(),
+    qr{\Q<bar>FOO</bar>\E},
+    'transformation works.',
+);
+
+}
+# TEST
+ok(1, 'Did not crash.');

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to