Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-XML-Feed for openSUSE:Factory checked in at 2021-06-01 10:37:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-XML-Feed (Old) and /work/SRC/openSUSE:Factory/.perl-XML-Feed.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-XML-Feed" Tue Jun 1 10:37:46 2021 rev:4 rq:895851 version:0.63 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-XML-Feed/perl-XML-Feed.changes 2021-01-29 14:58:00.285589519 +0100 +++ /work/SRC/openSUSE:Factory/.perl-XML-Feed.new.1898/perl-XML-Feed.changes 2021-06-01 10:39:01.272972348 +0200 @@ -1,0 +2,16 @@ +Wed May 26 03:08:22 UTC 2021 - Tina M??ller <timueller+p...@suse.de> + +- updated to 0.63 + see /usr/share/doc/packages/perl-XML-Feed/ChangeLog.md + + ## [0.63] - 2021-05-25 + ### Fixed + * Fixed a bug with non-UTC time zones (thanks @nanto) + ## [0.62] - 2021-05-24 + ### Fixed + * Fixed a broken constructor call (thanks @bbkr) + * Reduced some code complexity + ### Added + * Added an explicit "use" statement + +------------------------------------------------------------------- Old: ---- XML-Feed-0.61.tar.gz New: ---- XML-Feed-0.63.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-XML-Feed.spec ++++++ --- /var/tmp/diff_new_pack.KKG35O/_old 2021-06-01 10:39:01.748973158 +0200 +++ /var/tmp/diff_new_pack.KKG35O/_new 2021-06-01 10:39:01.748973158 +0200 @@ -18,7 +18,7 @@ %define cpan_name XML-Feed Name: perl-XML-Feed -Version: 0.61 +Version: 0.63 Release: 0 Summary: Syndication feed parser and auto-discovery License: Artistic-1.0 OR GPL-1.0-or-later ++++++ XML-Feed-0.61.tar.gz -> XML-Feed-0.63.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/ChangeLog.md new/XML-Feed-0.63/ChangeLog.md --- old/XML-Feed-0.61/ChangeLog.md 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/ChangeLog.md 2021-05-25 09:41:54.000000000 +0200 @@ -4,6 +4,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.63] - 2021-05-25 + +### Fixed + +* Fixed a bug with non-UTC time zones (thanks @nanto) + +## [0.62] - 2021-05-24 + +### Fixed + +* Fixed a broken constructor call (thanks @bbkr) +* Reduced some code complexity + +### Added + +* Added an explicit "use" statement + ## [0.61] - 2021-01-28 ### Fixed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/MANIFEST new/XML-Feed-0.63/MANIFEST --- old/XML-Feed-0.61/MANIFEST 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/MANIFEST 2021-05-25 09:41:54.000000000 +0200 @@ -52,6 +52,7 @@ t/27-dummy-content-encoded.t t/28-rss-guid.t t/29-date-parsing.t +t/30-date-format-timezone.t t/has-version.t t/pod-coverage.t t/pod.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/META.json new/XML-Feed-0.63/META.json --- old/XML-Feed-0.61/META.json 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/META.json 2021-05-25 09:41:54.000000000 +0200 @@ -53,39 +53,39 @@ "provides" : { "XML::Feed" : { "file" : "lib/XML/Feed.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Content" : { "file" : "lib/XML/Feed/Content.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Enclosure" : { "file" : "lib/XML/Feed/Enclosure.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Entry" : { "file" : "lib/XML/Feed/Entry.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Entry::Format::Atom" : { "file" : "lib/XML/Feed/Entry/Format/Atom.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Entry::Format::RSS" : { "file" : "lib/XML/Feed/Entry/Format/RSS.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Format::Atom" : { "file" : "lib/XML/Feed/Format/Atom.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Format::RSS" : { "file" : "lib/XML/Feed/Format/RSS.pm", - "version" : "0.61" + "version" : "0.63" }, "XML::Feed::Util" : { "file" : "lib/XML/Feed/Util.pm", - "version" : "0.61" + "version" : "0.63" } }, "release_status" : "stable", @@ -102,7 +102,7 @@ "web" : "https://github.com/davorg/xml-feed" } }, - "version" : "0.61", + "version" : "0.63", "x_contributors" : [ "Dave Cross <davecr...@cpan.org>", "Jakob Voss <v...@gbv.de>", @@ -114,5 +114,5 @@ "Gerard Ribugent Navarro <ribug...@cpan.org>", "Matthew D. Miller <matthew.mil...@okbu.edu>" ], - "x_serialization_backend" : "JSON::PP version 4.04" + "x_serialization_backend" : "JSON::PP version 4.06" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/META.yml new/XML-Feed-0.63/META.yml --- old/XML-Feed-0.61/META.yml 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/META.yml 2021-05-25 09:41:54.000000000 +0200 @@ -17,31 +17,31 @@ provides: XML::Feed: file: lib/XML/Feed.pm - version: '0.61' + version: '0.63' XML::Feed::Content: file: lib/XML/Feed/Content.pm - version: '0.61' + version: '0.63' XML::Feed::Enclosure: file: lib/XML/Feed/Enclosure.pm - version: '0.61' + version: '0.63' XML::Feed::Entry: file: lib/XML/Feed/Entry.pm - version: '0.61' + version: '0.63' XML::Feed::Entry::Format::Atom: file: lib/XML/Feed/Entry/Format/Atom.pm - version: '0.61' + version: '0.63' XML::Feed::Entry::Format::RSS: file: lib/XML/Feed/Entry/Format/RSS.pm - version: '0.61' + version: '0.63' XML::Feed::Format::Atom: file: lib/XML/Feed/Format/Atom.pm - version: '0.61' + version: '0.63' XML::Feed::Format::RSS: file: lib/XML/Feed/Format/RSS.pm - version: '0.61' + version: '0.63' XML::Feed::Util: file: lib/XML/Feed/Util.pm - version: '0.61' + version: '0.63' requires: Class::ErrorHandler: '0' DateTime: '0' @@ -67,7 +67,7 @@ bugtracker: https://github.com/davorg/xml-feed/issues license: http://dev.perl.org/licenses/ repository: https://github.com/davorg/xml-feed.git -version: '0.61' +version: '0.63' x_contributors: - 'Dave Cross <davecr...@cpan.org>' - 'Jakob Voss <v...@gbv.de>' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/eg/check_feed.pl new/XML-Feed-0.63/eg/check_feed.pl --- old/XML-Feed-0.61/eg/check_feed.pl 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/eg/check_feed.pl 2021-05-25 09:41:54.000000000 +0200 @@ -46,15 +46,20 @@ say ''; for (@entry_attrs) { - my $method = lc $_; - my $data; - if ($use_body_attrs{$_}) { - $data = $entry->$method->body // ''; - } else { - $data = $entry->$method // ''; - } - - printf(" * %-11s %s\n", "$_:", $data); + say get_attribute($entry, $_); } } +sub get_attribute { + my ($entry, $attr) = @_; + + my $method = lc $attr; + my $data; + if ($use_body_attrs{$attr}) { + $data = $entry->$method->body // ''; + } else { + $data = $entry->$method // ''; + } + + return sprintf(" * %-11s %s", "$attr:", $data); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Content.pm new/XML-Feed-0.63/lib/XML/Feed/Content.pm --- old/XML-Feed-0.61/lib/XML/Feed/Content.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Content.pm 2021-05-25 09:41:54.000000000 +0200 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( Class::ErrorHandler ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Enclosure.pm new/XML-Feed-0.63/lib/XML/Feed/Enclosure.pm --- old/XML-Feed-0.61/lib/XML/Feed/Enclosure.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Enclosure.pm 2021-05-25 09:41:54.000000000 +0200 @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( Class::ErrorHandler ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Entry/Format/Atom.pm new/XML-Feed-0.63/lib/XML/Feed/Entry/Format/Atom.pm --- old/XML-Feed-0.61/lib/XML/Feed/Entry/Format/Atom.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Entry/Format/Atom.pm 2021-05-25 09:41:54.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use v5.10; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( XML::Feed::Entry ); use XML::Feed::Content; @@ -37,6 +37,13 @@ sub summary { my $entry = shift; + + my %type_correction = ( + html => 'text/html', + text => 'text/plain', + xhtml => 'text/html', + ); + if (@_) { my %param; if (ref($_[0]) eq 'XML::Feed::Content') { @@ -49,9 +56,8 @@ my $s = $entry->{entry}->summary; # map Atom types to MIME types my $type = ($s && ref($s) eq 'XML::Feed::Content') ? $s->type : undef; - if ($type) { - $type = 'text/html' if $type eq 'xhtml' || $type eq 'html'; - $type = 'text/plain' if $type eq 'text'; + if ($type and exists $type_correction{$type}) { + $type = $type_correction{$type}; } my $body = $s; if (defined $s && ref($s) eq 'XML::Feed::Content') { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Entry/Format/RSS.pm new/XML-Feed-0.63/lib/XML/Feed/Entry/Format/RSS.pm --- old/XML-Feed-0.61/lib/XML/Feed/Entry/Format/RSS.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Entry/Format/RSS.pm 2021-05-25 09:41:54.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use v5.10; -our $VERSION = '0.61'; +our $VERSION = '0.63'; sub format { 'RSS ' . $_[0]->{'_version'} } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Entry.pm new/XML-Feed-0.63/lib/XML/Feed/Entry.pm --- old/XML-Feed-0.61/lib/XML/Feed/Entry.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Entry.pm 2021-05-25 09:41:54.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use v5.10; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( Class::ErrorHandler ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Format/Atom.pm new/XML-Feed-0.63/lib/XML/Feed/Format/Atom.pm --- old/XML-Feed-0.61/lib/XML/Feed/Format/Atom.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Format/Atom.pm 2021-05-25 09:41:54.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use v5.10; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( XML::Feed ); use XML::Atom::Feed; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Format/RSS.pm new/XML-Feed-0.63/lib/XML/Feed/Format/RSS.pm --- old/XML-Feed-0.61/lib/XML/Feed/Format/RSS.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Format/RSS.pm 2021-05-25 09:41:54.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use v5.10; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( XML::Feed ); use DateTime::Format::Mail; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed/Util.pm new/XML-Feed-0.63/lib/XML/Feed/Util.pm --- old/XML-Feed-0.61/lib/XML/Feed/Util.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed/Util.pm 2021-05-25 09:41:54.000000000 +0200 @@ -2,13 +2,14 @@ use strict; use warnings; -our $VERSION = '0.61'; +our $VERSION = '0.63'; use base qw( Exporter ); use DateTime::Format::Flexible; use DateTime::Format::ISO8601; use DateTime::Format::Natural; use DateTime::Format::W3CDTF; +use DateTime::Format::Mail; our @EXPORT_OK = qw( format_w3cdtf @@ -18,10 +19,12 @@ ); sub format_w3cdtf { - my $date = DateTime::Format::W3CDTF->format_datetime(shift); + my $dt = shift; + + my $date = DateTime::Format::W3CDTF->format_datetime($dt); # Add timezone "Z" if "floating" DateTime. - $date =~ s/(:\d\d(?:\.\d+)?)\s*$/$1Z/; + $date .= 'Z' if $dt->time_zone->is_floating; return $date; } @@ -45,7 +48,7 @@ $ts = _strip_spaces($ts); - return eval { DateTime::Format::Mail(loose => 1)->parse_datetime($ts) } + return eval { DateTime::Format::Mail->new(loose => 1)->parse_datetime($ts) } || parse_datetime($ts); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/lib/XML/Feed.pm new/XML-Feed-0.63/lib/XML/Feed.pm --- old/XML-Feed-0.61/lib/XML/Feed.pm 2021-01-28 15:25:24.000000000 +0100 +++ new/XML-Feed-0.63/lib/XML/Feed.pm 2021-05-25 09:41:54.000000000 +0200 @@ -13,7 +13,7 @@ require => 1, sub_name => 'formatters'; -our $VERSION = '0.61'; +our $VERSION = '0.63'; our $MULTIPLE_ENCLOSURES = 0; our @formatters; BEGIN { @@ -44,16 +44,9 @@ } elsif (ref($stream) eq 'SCALAR') { $xml = $$stream; } elsif (ref($stream)) { - while (read($stream, my($chunk), 8192)) { - $xml .= $chunk; - } + $xml = $class->get_fh($stream); } else { - open my $fh, '<', $stream - or return $class->error("Can't open $stream: $!"); - while (read $fh, my($chunk), 8192) { - $xml .= $chunk; - } - close $fh; + $xml = $class->get_file($stream); } return $class->error("Can't get feed XML content from $stream") unless $xml; @@ -72,6 +65,30 @@ $feed; } +sub get_file { + my $class = shift; + my ($filename) = @_; + + open my $fh, '<', $filename + or return $class->error("Can't open $filename: $!"); + my $xml = $class->get_fh($fh); + close $fh; + + return $xml; +} + +sub get_fh { + my $class = shift; + my ($fh) = @_; + + my $xml; + while (read $fh, my($chunk), 8192) { + $xml .= $chunk; + } + + return $xml; +} + sub get_uri { my $class = shift; my ($stream) = @_; @@ -277,6 +294,14 @@ I<$format> allows you to override format guessing. +=head2 XML::Feed->get_file($filename) + +Gets a feed from a file. + +=head3 CML::Feed->get_fh($fh) + +Gets a feed from pre-opened filehandle. + =head2 XML::Feed->get_uri($uri) Gets a feed from a URI. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/XML-Feed-0.61/t/30-date-format-timezone.t new/XML-Feed-0.63/t/30-date-format-timezone.t --- old/XML-Feed-0.61/t/30-date-format-timezone.t 1970-01-01 01:00:00.000000000 +0100 +++ new/XML-Feed-0.63/t/30-date-format-timezone.t 2021-05-25 09:41:54.000000000 +0200 @@ -0,0 +1,40 @@ +use strict; +use warnings; +use Test::More; + +use DateTime; +use XML::XPath; + +use XML::Feed; +use XML::Feed::Entry; + +# https://github.com/davorg/xml-feed/issues/55 + +my $feed = XML::Feed->new('Atom'); + +# Bugs are with DateTime with non-UTC time zone. +my $dt = DateTime->now(time_zone => 'Asia/Tokyo'); + +$feed->title("My Atom feed"); +$feed->link("http://www.example.com"); +$feed->author("Author"); +$feed->updated($dt); +$feed->id("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344eaa6a"); + +my $entry = XML::Feed::Entry->new('Atom'); +$entry->title("An important event"); +$entry->author("Important author"); +$entry->content("A very interesting event happened."); + +$entry->issued($dt); +$entry->updated($dt); +$entry->id("urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a"); + +$feed->add_entry($entry); + +my $xp = XML::XPath->new(xml => $feed->as_xml); +my $rfc3339 = qr!<updated>\d{4}-\d{2}-\d{2}T.+\+09:00</updated>!; +like $xp->findnodes_as_string('/feed/updated'), $rfc3339; +like $xp->findnodes_as_string('/feed/entry/updated'), $rfc3339; + +done_testing();