Hello community,

here is the log from the commit of package perl-XML-Writer for openSUSE:Factory 
checked in at 2020-10-08 13:10:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-XML-Writer (Old)
 and      /work/SRC/openSUSE:Factory/.perl-XML-Writer.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-XML-Writer"

Thu Oct  8 13:10:16 2020 rev:33 rq:840017 version:0.900

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-XML-Writer/perl-XML-Writer.changes  
2015-04-25 21:16:55.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-XML-Writer.new.4249/perl-XML-Writer.changes    
    2020-10-08 13:11:17.819124239 +0200
@@ -1,0 +2,6 @@
+Wed Oct  7 03:16:32 UTC 2020 - Tina Müller <[email protected]>
+
+- updated to 0.900
+   see /usr/share/doc/packages/perl-XML-Writer/Changes
+
+-------------------------------------------------------------------

Old:
----
  XML-Writer-0.625.tar.gz

New:
----
  XML-Writer-0.900.tar.gz

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

Other differences:
------------------
++++++ perl-XML-Writer.spec ++++++
--- /var/tmp/diff_new_pack.BOmjTT/_old  2020-10-08 13:11:18.723125057 +0200
+++ /var/tmp/diff_new_pack.BOmjTT/_new  2020-10-08 13:11:18.727125061 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-XML-Writer
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,20 +12,20 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           perl-XML-Writer
-Version:        0.625
+Version:        0.900
 Release:        0
 #Upstream: SUSE-Public-Domain
 %define cpan_name XML-Writer
 Summary:        Perl extension for writing XML documents
 License:        MIT
 Group:          Development/Libraries/Perl
-Url:            http://search.cpan.org/dist/XML-Writer/
-Source0:        
http://www.cpan.org/authors/id/J/JO/JOSEPHW/%{cpan_name}-%{version}.tar.gz
+URL:            https://metacpan.org/release/%{cpan_name}
+Source0:        
https://cpan.metacpan.org/authors/id/J/JO/JOSEPHW/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -54,13 +54,14 @@
 
 %prep
 %setup -q -n %{cpan_name}-%{version}
+find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path 
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
 
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
-%{__make} %{?_smp_mflags}
+perl Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
 
 %check
-%{__make} test
+make test
 
 %install
 %perl_make_install
@@ -69,6 +70,7 @@
 
 %files -f %{name}.files
 %defattr(-,root,root,755)
-%doc Changes examples LICENSE README TODO
+%doc Changes examples README TODO
+%license LICENSE
 
 %changelog

++++++ XML-Writer-0.625.tar.gz -> XML-Writer-0.900.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Writer-0.625/Changes new/XML-Writer-0.900/Changes
--- old/XML-Writer-0.625/Changes        2014-06-05 15:56:29.000000000 +0200
+++ new/XML-Writer-0.900/Changes        2020-04-24 16:50:13.000000000 +0200
@@ -1,6 +1,11 @@
 Revision history for Perl extension XML::Writer.
 
-0.625 Thu 05 Jun 2014 23:55:42 +1000    <[email protected]>
+0.900 Fri Mar  8 00:19:28 2019 +1100    <[email protected]>
+        - Drop support for building on (very) old perls.
+        - Check for valid element names (#107239)
+        - Fail when a scalar other than 'self' is passed as OUTPUT.
+
+0.625 Thu Jun  5 23:55:42 2014 +1000    <[email protected]>
         - Allow xml-model processing instructions (#94078).
         - Don't warn when undef is passed to setOutput (#94369).
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Writer-0.625/META.yml 
new/XML-Writer-0.900/META.yml
--- old/XML-Writer-0.625/META.yml       2014-06-05 15:56:29.000000000 +0200
+++ new/XML-Writer-0.900/META.yml       2020-04-24 16:50:13.000000000 +0200
@@ -3,7 +3,7 @@
   version: 1.4
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
 name:         XML-Writer
-version:      0.625
+version:      0.900
 abstract:     Easily generate well-formed, namespace-aware XML.
 author:
   - David Megginson <[email protected]>
@@ -14,10 +14,8 @@
 installdirs:  site
 
 build_requires:
-  perl: 5.006_000
-  Test::More: 0.047
-recommends:
   perl: 5.008_001
+  Test::More: 0.047
 
 no_index:
   package:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Writer-0.625/Makefile.PL 
new/XML-Writer-0.900/Makefile.PL
--- old/XML-Writer-0.625/Makefile.PL    2014-06-05 15:56:29.000000000 +0200
+++ new/XML-Writer-0.900/Makefile.PL    2020-04-24 16:50:13.000000000 +0200
@@ -7,7 +7,7 @@
 # the contents of the Makefile that is written.
 WriteMakefile(
     'NAME'    => 'XML::Writer',
-    'VERSION' => '0.625',
+    'VERSION' => '0.900',
 
     # A manually-created META.yml has all the other metadata;
     #  we don't want it overwritten
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Writer-0.625/Writer.pm 
new/XML-Writer-0.900/Writer.pm
--- old/XML-Writer-0.625/Writer.pm      2014-06-05 15:56:29.000000000 +0200
+++ new/XML-Writer-0.900/Writer.pm      2020-04-24 16:50:13.000000000 +0200
@@ -15,7 +15,7 @@
 use vars qw($VERSION);
 use Carp;
 use IO::Handle;
-$VERSION = "0.625";
+$VERSION = "0.900";
 
 use overload '""' => \&_overload_string;
 
@@ -266,8 +266,9 @@
   my $SAFE_startTag = sub {
     my $name = $_[0];
 
+    _croakUnlessValidName($name);
     &{$checkUnencodedRepertoire}($name);
-    _checkAttributes(\@_);
+    _checkAttributes(\@_, $checkUnencodedRepertoire);
 
     if ($seen{ELEMENT} && $elementLevel == 0) {
       croak("Attempt to insert start tag after close of document element");
@@ -301,8 +302,9 @@
   my $SAFE_emptyTag = sub {
     my $name = $_[0];
 
+    _croakUnlessValidName($name);
     &{$checkUnencodedRepertoire}($name);
-    _checkAttributes(\@_);
+    _checkAttributes(\@_, $checkUnencodedRepertoire);
 
     if ($seen{ELEMENT} && $elementLevel == 0) {
       croak("Attempt to insert empty tag after close of document element");
@@ -470,9 +472,13 @@
   $self->{'SETOUTPUT'} = sub {
     my $newOutput = $_[0];
 
-    if (defined($newOutput) && !ref($newOutput) && 'self' eq $newOutput ) {
-      $newOutput = \$selfcontained_output;
-      $use_selfcontained_output = 1;
+    if (defined($newOutput) && !ref($newOutput)) {
+      if ('self' eq $newOutput ) {
+        $newOutput = \$selfcontained_output;
+        $use_selfcontained_output = 1;
+      } else {
+        die "Output must be a handle, a reference or 'self'";
+      }
     }
 
     if (ref($newOutput) eq 'SCALAR') {
@@ -776,6 +782,8 @@
 sub _checkAttributes {
   my %anames;
   my $i = 1;
+  my $checkUnencodedRepertoire = $_[1];
+
   while ($_[0]->[$i]) {
     my $name = $_[0]->[$i];
     $i += 1;
@@ -784,6 +792,8 @@
     } else {
       $anames{$name} = 1;
     }
+    _croakUnlessValidName($name);
+    &{$checkUnencodedRepertoire}($name);
     _croakUnlessDefinedCharacters($_[0]->[$i]);
     $i += 1;
   }
@@ -821,6 +831,30 @@
   }
 }
 
+# Ensure element and attribute names are non-empty, contain no whitespace and 
are
+#  otherwise valid XML names
+sub _croakUnlessValidName($) {
+  if ($_[0] eq '') {
+    croak('Empty identifiers are not permitted in this part of an XML 
document');
+  }
+  if ($_[0] =~ /\s/) {
+    croak('Space characters are not permitted in this part of an XML 
identifier');
+  }
+
+  # From REC-xml-20081126
+  #  [4]       NameStartChar      ::=          ":" | [A-Z] | "_" | [a-z] | 
[#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | 
[#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | 
[#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+  #  [4a]      NameChar           ::=          NameStartChar | "-" | "." | 
[0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
+  #  [5]       Name       ::=          NameStartChar (NameChar)*
+
+  if ($_[0] !~ 
/^[:A-Z_a-z\x{C0}-\x{D6}\x{D8}-\x{F6}\x{F8}-\x{2FF}\x{370}-\x{37D}\x{37F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}\x{EFFFF}][-.0-9\x{B7}\x{0300}-\x{036F}\x{203F}-\x{2040}:A-Z_a-z\x{C0}-\x{D6}\x{D8}-\x{F6}\x{F8}-\x{2FF}\x{370}-\x{37D}\x{37F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}\x{EFFFF}]*$/)
 {
+    croak('Not a valid XML name: '.$_[0]);
+  }
+
+         #       ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | 
[#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | 
[#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | 
[#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
+
+         #       | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
+}
+
 sub _overload_string {
     my $self = shift;
     $self->{OVERLOADSTRING}->() || overload::StrVal($self);
@@ -914,9 +948,11 @@
       $clashMap{$p} = $u;
     }
 
-    while (!defined($prefix) || ($clashMap{$prefix} && $clashMap{$prefix} ne 
$uri)) {
-      $prefix = "__NS$prefixCounter";
-      $prefixCounter++;
+    if (!defined($prefix)) {
+      do {
+        $prefix = "__NS$prefixCounter";
+        $prefixCounter++;
+      } while ($clashMap{$prefix});
     }
 
     return $prefix;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/XML-Writer-0.625/t/01_main.t 
new/XML-Writer-0.900/t/01_main.t
--- old/XML-Writer-0.625/t/01_main.t    2014-06-05 15:56:29.000000000 +0200
+++ new/XML-Writer-0.900/t/01_main.t    2020-04-24 16:50:13.000000000 +0200
@@ -15,7 +15,7 @@
 
 use Errno;
 
-use Test::More(tests => 246);
+use Test::More(tests => 262);
 
 
 # Catch warnings
@@ -34,20 +34,9 @@
        }
 }
 
-# Constants for Unicode support
-my $unicodeSkipMessage = 'Unicode only supported with Perl >= 5.8.1';
-
-sub isUnicodeSupported()
-{
-       return $] >= 5.008001;
-}
-
 require XML::Writer;
 
-SKIP: {
-       skip "Perls before 5.6 always warn when loading XML::Writer", 1 if $] <=
-       5.006;
-
+TEST: {
        wasNoWarning('Loading XML::Writer should not result in warnings');
 }
 
@@ -62,7 +51,7 @@
 sub getBufStr()
 {
        local($/);
-       binmode($outputFile, ':bytes') if isUnicodeSupported();
+       binmode($outputFile, ':bytes');
        $outputFile->seek(0, 0);
        return <$outputFile>;
 }
@@ -279,6 +268,35 @@
        checkResult("<foo></foo>\n", 'A separate start and end tag');
 };
 
+# Empty element names and names with spaces
+TEST: {
+       initEnv();
+       expectError("Empty identifiers are not permitted in this part of ", 
eval {
+               $w->emptyTag("");
+       });
+}
+
+TEST: {
+       initEnv();
+       expectError("Space characters are not permitted in this part of ", eval 
{
+               $w->emptyTag("a\tb");
+       });
+}
+
+TEST: {
+       initEnv(ENCODING => 'us-ascii');
+       expectError("Empty identifiers are not permitted in this part of ", 
eval {
+               $w->emptyTag("");
+       });
+}
+
+TEST: {
+       initEnv(ENCODING => 'us-ascii');
+       expectError("Space characters are not permitted in this part of ", eval 
{
+               $w->emptyTag("a\tb");
+       });
+}
+
 # Attributes
 TEST: {
        initEnv();
@@ -287,6 +305,20 @@
        checkResult("<foo x=\"1&gt;2\" />\n", 'Simple attributes');
 };
 
+TEST: {
+       initEnv();
+       expectError("Space characters are not permitted in this part of ", eval 
{
+               $w->emptyTag("foo", "a b" => "2>1");
+       });
+}
+
+TEST: {
+       initEnv(ENCODING => 'us-ascii');
+       expectError("Space characters are not permitted in this part of ", eval 
{
+               $w->emptyTag("foo", "a b" => "2>1");
+       });
+}
+
 # Character data
 TEST: {
        initEnv();
@@ -1405,9 +1437,7 @@
 };
 
 # Make sure UTF-8 is written properly
-SKIP: {
-       skip $unicodeSkipMessage, 2 unless isUnicodeSupported();
-
+TEST: {
        initEnv(ENCODING => 'utf-8', DATA_MODE => 1);
 
        $w->xmlDecl();
@@ -1441,6 +1471,30 @@
 EOR
 };
 
+# Test UTF-8 element name
+TEST: {
+       # I need U+00E9 as an is_utf8 string; I want to keep the source ASCII.
+       # There must be a better way to do this.
+       require Encode;
+       my $text = Encode::decode('iso-8859-1', "\x{E9}");
+
+       initEnv(ENCODING => 'utf-8');
+       $w->emptyTag("r${text}sum${text}");
+       checkResult("<r\x{C3}\x{A9}sum\x{C3}\x{A9} />", 'E-acute element name 
permitted');
+};
+
+# Test UTF-8 attribute name
+TEST: {
+       # I need U+00E9 as an is_utf8 string; I want to keep the source ASCII.
+       # There must be a better way to do this.
+       require Encode;
+       my $text = Encode::decode('iso-8859-1', "\x{E9}");
+
+       initEnv(ENCODING => 'utf-8');
+       $w->emptyTag("foo", "fianc${text}" => 'true');
+       checkResult("<foo fianc\x{C3}\x{A9}=\"true\" />", 'E-acute attribute 
name permitted');
+};
+
 # Capture generated XML in a scalar
 TEST: {
        initEnv();
@@ -1489,9 +1543,7 @@
 }
 
 # Make sure scalars are built up as UTF-8 (if UTF-8 is passed in)
-SKIP: {
-       skip $unicodeSkipMessage, 2 unless isUnicodeSupported();
-
+TEST: {
        initEnv();
        my $s;
 
@@ -1520,9 +1572,7 @@
 }
 
 # Test US-ASCII encoding
-SKIP: {
-       skip $unicodeSkipMessage, 7 unless isUnicodeSupported();
-
+TEST: {
        initEnv(ENCODING => 'us-ascii', DATA_MODE => 1);
 
        $w->xmlDecl();
@@ -1574,6 +1624,18 @@
        });
 
 
+       initEnv(ENCODING => 'us-ascii', DATA_MODE => 1);
+       expectError("Non-ASCII characters are not permitted in this part of ", 
eval {
+               $w->emptyTag("r\x{E9}sum\x{E9}");
+       });
+
+
+       initEnv(ENCODING => 'us-ascii', DATA_MODE => 1);
+       expectError("Non-ASCII characters are not permitted in this part of ", 
eval {
+               $w->emptyTag("foo", "fianc\x{E9}" => 'true');
+       });
+
+
        # Make sure Unicode generates warnings when it makes it through
        #  to a US-ASCII-encoded stream
        initEnv(ENCODING => 'us-ascii', DATA_MODE => 1, UNSAFE => 1);
@@ -1636,9 +1698,7 @@
 }
 
 # Test characters outside the BMP
-SKIP: {
-       skip $unicodeSkipMessage, 4 unless isUnicodeSupported();
-
+TEST: {
        my $s = "\x{10480}"; # U+10480 OSMANYA LETTER ALEF
 
        initEnv(ENCODING => 'utf-8');
@@ -1759,9 +1819,7 @@
 }
 
 # Cover XML declaration encoding cases
-SKIP: {
-       skip $unicodeSkipMessage, 8 unless isUnicodeSupported();
-
+TEST: {
        # No declaration unless specified
        initEnv();
        $w->xmlDecl();
@@ -2028,15 +2086,43 @@
 };
 
 # We should try to set the encoding on GLOBs as well as IO::Handles
-SKIP: {
-       skip $unicodeSkipMessage, 1 unless isUnicodeSupported();
-
+TEST: {
        expectError('encoding', eval {
                initEnv(OUTPUT => \*STDOUT,
                        ENCODING => 'x-unsupported-encoding');
        });
 };
 
+# Confirm that a scalar other than 'self' is treated as an error
+TEST: {
+       expectError('Output must be a handle', eval {
+               initEnv(OUTPUT => 'not-self');
+       });
+}
+
+# Unsafe mode should not enforce element name checks
+TEST: {
+       initEnv(UNSAFE => 1);
+
+       $w->startTag('te<xt');
+       $w->emptyTag('te<xt');
+       $w->endTag('te<xt');
+       $w->end();
+
+       checkResult(<<"EOR", 'Unsafe mode should not enforce element name 
checks');
+<te<xt><te<xt /></te<xt>
+EOR
+}
+
+# Safe mode should enforce element name checks
+TEST: {
+       initEnv();
+
+       expectError("Not a valid XML name: te<xt", eval {
+               $w->emptyTag("te<xt");
+        });
+}
+
 # Free test resources
 $outputFile->close() or die "Unable to close temporary file: $!";
 


Reply via email to