[libsoap-wsdl-perl] 03/08: comment changes introducing prefix_from_namespace

Damyan Ivanov dmn at moszumanska.debian.org
Wed Jan 15 09:50:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

dmn pushed a commit to branch master
in repository libsoap-wsdl-perl.

commit 56dca1d8baeab51b05cbad1efdf76598e9b9894f
Author: Damyan Ivanov <dmn at debian.org>
Date:   Wed Jan 15 09:21:48 2014 +0000

    comment changes introducing prefix_from_namespace
---
 debian/patches/003_wsdl_based_serializer.t.patch | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/debian/patches/003_wsdl_based_serializer.t.patch b/debian/patches/003_wsdl_based_serializer.t.patch
index 79fd315..fa5a7eb 100644
--- a/debian/patches/003_wsdl_based_serializer.t.patch
+++ b/debian/patches/003_wsdl_based_serializer.t.patch
@@ -1,17 +1,34 @@
 --- a/lib/SOAP/WSDL/Base.pm
 +++ b/lib/SOAP/WSDL/Base.pm
-@@ -174,6 +174,19 @@ sub schema {
+@@ -174,6 +174,36 @@ sub schema {
      return $parent->schema();
  }
  
++# this is used when we have a namespaces hash, but need to find the prefix to
++# some namespace
++# using %prefix = reverse %namespace; can break, as %namespace may contain
++# duplicate values, due to the '#default' key:
++#
++#      '#default' => 'urn:myNamespace',
++#      'tns'      => 'urn:myNamespace',
++#      'xml'      => 'http://www.w3.org/XML/1998/namespace',
++#      'wsdl'     => 'http://schemas.xmlsoap.org/wsdl/',
++#      'xsd'      => 'http://www.w3.org/2001/XMLSchema',
++#      'soap'     => 'http://schemas.xmlsoap.org/wsdl/soap/'
++#
++# 'reverse'-ing that with Perl 5.18 gives 'urn:myNamespace' => '#default' or
++# 'urn:myNamespace' => 'tns' with 50% probability due to the hash randomization
++# feature.
++# Using reverse causes t/003_wsdl_based_serializer.t to fail most of the time
++
 +sub prefix_from_namespace {
 +    my ( $self, $ns ) = @_;
 +
 +    my %prefix;
 +
 +    while ( my ( $prefix, $ns ) = each %$ns ) {
-+        next if $prefix eq '#default';
-+        $prefix{$ns} = $prefix;
++        $prefix{$ns} = $prefix
++            unless $prefix eq '#default' and exists $prefix{$ns};
 +    }
 +
 +    return \%prefix;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libsoap-wsdl-perl.git



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