Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-Mojolicious for
openSUSE:Factory checked in at 2022-11-24 12:24:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojolicious (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojolicious.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojolicious"
Thu Nov 24 12:24:09 2022 rev:169 rq:1037664 version:9.30
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojolicious/perl-Mojolicious.changes
2022-11-08 10:54:51.337755842 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Mojolicious.new.1597/perl-Mojolicious.changes
2022-11-24 12:24:10.837660292 +0100
@@ -1,0 +2,14 @@
+Wed Nov 23 16:50:57 UTC 2022 - Tina Müller <[email protected]>
+
+- updated to 9.30
+ see /usr/share/doc/packages/perl-Mojolicious/Changes
+
+ 9.30 2022-11-22
+ - Added EXPERIMENTAL support for parsing and generating Link headers.
+ - Added EXPERIMENTAL links method to Mojo::Headers.
+ - Added EXPERIMENTAL header_params function to Mojo::Util.
+
+ 9.29 2022-11-11
+ - Fixed a bug where promises returning promises were not handled
correctly. (batman)
+
+-------------------------------------------------------------------
Old:
----
Mojolicious-9.28.tar.gz
New:
----
Mojolicious-9.30.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojolicious.spec ++++++
--- /var/tmp/diff_new_pack.yGj7mh/_old 2022-11-24 12:24:11.901667054 +0100
+++ /var/tmp/diff_new_pack.yGj7mh/_new 2022-11-24 12:24:11.905667079 +0100
@@ -18,7 +18,7 @@
%define cpan_name Mojolicious
Name: perl-Mojolicious
-Version: 9.28
+Version: 9.30
Release: 0
License: Artistic-2.0
Summary: Real-time web framework
++++++ Mojolicious-9.28.tar.gz -> Mojolicious-9.30.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/Changes new/Mojolicious-9.30/Changes
--- old/Mojolicious-9.28/Changes 2022-10-14 20:53:42.000000000 +0200
+++ new/Mojolicious-9.30/Changes 2022-11-23 01:43:59.000000000 +0100
@@ -1,4 +1,12 @@
+9.30 2022-11-22
+ - Added EXPERIMENTAL support for parsing and generating Link headers.
+ - Added EXPERIMENTAL links method to Mojo::Headers.
+ - Added EXPERIMENTAL header_params function to Mojo::Util.
+
+9.29 2022-11-11
+ - Fixed a bug where promises returning promises were not handled correctly.
(batman)
+
9.28 2022-09-12
- Fixed a bug where async/await use could result in unhandled promise
warnings. (batman)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/META.json
new/Mojolicious-9.30/META.json
--- old/Mojolicious-9.28/META.json 2022-10-14 20:54:49.000000000 +0200
+++ new/Mojolicious-9.30/META.json 2022-11-23 12:51:45.000000000 +0100
@@ -64,6 +64,6 @@
"web" : "https://web.libera.chat/#mojo"
}
},
- "version" : "9.28",
+ "version" : "9.30",
"x_serialization_backend" : "JSON::PP version 4.07"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/META.yml
new/Mojolicious-9.30/META.yml
--- old/Mojolicious-9.28/META.yml 2022-10-14 20:54:49.000000000 +0200
+++ new/Mojolicious-9.30/META.yml 2022-11-23 12:51:45.000000000 +0100
@@ -35,5 +35,5 @@
homepage: https://mojolicious.org
license: http://www.opensource.org/licenses/artistic-license-2.0
repository: https://github.com/mojolicious/mojo.git
-version: '9.28'
+version: '9.30'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/lib/Mojo/DOM.pm
new/Mojolicious-9.30/lib/Mojo/DOM.pm
--- old/Mojolicious-9.28/lib/Mojo/DOM.pm 2022-06-14 13:31:51.000000000
+0200
+++ new/Mojolicious-9.30/lib/Mojo/DOM.pm 2022-10-31 14:36:40.000000000
+0100
@@ -428,7 +428,7 @@
While all node types are represented as L<Mojo::DOM> objects, some methods
like L</"attr"> and L</"namespace"> only
apply to elements.
-=head1 CASE-SENSITIVITY
+=head1 HTML AND XML
L<Mojo::DOM> defaults to HTML semantics, that means all tags and attribute
names are lowercased and selectors need to
be lowercase as well.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/lib/Mojo/Headers.pm
new/Mojolicious-9.30/lib/Mojo/Headers.pm
--- old/Mojolicious-9.28/lib/Mojo/Headers.pm 2022-06-14 13:31:51.000000000
+0200
+++ new/Mojolicious-9.30/lib/Mojo/Headers.pm 2022-11-23 01:11:08.000000000
+0100
@@ -2,7 +2,7 @@
use Mojo::Base -base;
use Carp qw(croak);
-use Mojo::Util qw(monkey_patch);
+use Mojo::Util qw(header_params monkey_patch);
has max_line_size => sub { $ENV{MOJO_MAX_LINE_SIZE} || 8192 };
has max_lines => sub { $ENV{MOJO_MAX_LINES} || 100 };
@@ -100,6 +100,22 @@
sub leftovers { delete shift->{buffer} }
+sub links {
+ my ($self, $links) = @_;
+
+ return $self->link(join(', ', map {qq{<$links->{$_}>; rel="$_"}} sort keys
%$links)) if $links;
+
+ my $header = $self->link // '';
+ my $data = {};
+ while ($header =~ s/^[,\s]*<(.+?)>//) {
+ my $target = $1;
+ (my $params, $header) = header_params $header;
+ $data->{$params->{rel}} //= {%$params, link => $target} if defined
$params->{rel};
+ }
+
+ return $data;
+}
+
sub names {
my $self = shift;
return [map { $NAMES{$_} || $self->{names}{$_} } sort keys
%{$self->{headers}}];
@@ -506,6 +522,18 @@
Get or replace current header value, shortcut for the C<Link> header from L<RFC
5988|https://tools.ietf.org/html/rfc5988>.
+=head2 links
+
+ my $links = $headers->links;
+ $headers = $headers->links({next => 'http://example.com/foo', prev =>
'http://example.com/bar'});
+
+Get or set web links from or to C<Link> header according to L<RFC
5988|http://tools.ietf.org/html/rfc5988>. Note that
+this method is B<EXPERIMENTAL> and might change without warning!
+
+ # Extract information about next page
+ say $headers->links->{next}{link};
+ say $headers->links->{next}{title};
+
=head2 location
my $location = $headers->location;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/lib/Mojo/Promise.pm
new/Mojolicious-9.30/lib/Mojo/Promise.pm
--- old/Mojolicious-9.28/lib/Mojo/Promise.pm 2022-10-14 20:52:39.000000000
+0200
+++ new/Mojolicious-9.30/lib/Mojo/Promise.pm 2022-10-31 14:36:40.000000000
+0100
@@ -230,8 +230,10 @@
}
sub _settle_await {
- my ($status, $self) = (shift, shift);
- @{$self}{qw(results status)} = ([@_], $status) if !$self->{results};
+ my ($status, $self, @results) = @_;
+ return $results[0]->then(sub { $self->resolve(@_); () }, sub {
$self->reject(@_); () })
+ if blessed $results[0] && $results[0]->can('then');
+ @{$self}{qw(results status)} = ([@results], $status) if !$self->{results};
$self->_defer;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/lib/Mojo/Util.pm
new/Mojolicious-9.30/lib/Mojo/Util.pm
--- old/Mojolicious-9.28/lib/Mojo/Util.pm 2022-06-14 13:31:51.000000000
+0200
+++ new/Mojolicious-9.30/lib/Mojo/Util.pm 2022-11-23 01:28:59.000000000
+0100
@@ -57,6 +57,10 @@
# "Sun, 06 Nov 1994 08:49:37 GMT" and "Sunday, 06-Nov-94 08:49:37 GMT"
my $EXPIRES_RE = qr/(\w+\W+\d+\W+\w+\W+\d+\W+\d+:\d+:\d+\W*\w+)/;
+# Header key/value pairs
+my $QUOTED_VALUE_RE = qr/\G=\s*("(?:\\\\|\\"|[^"])*")/;
+my $UNQUOTED_VALUE_RE = qr/\G=\s*([^;, ]*)/;
+
# HTML entities
my $ENTITY_RE = qr/&(?:\#((?:[0-9]{1,7}|x[0-9a-fA-F]{1,6}));|(\w+[;=]?))/;
@@ -65,10 +69,10 @@
our @EXPORT_OK = (
qw(b64_decode b64_encode camelize class_to_file class_to_path decamelize
decode deprecated dumper encode),
- qw(extract_usage getopt gunzip gzip hmac_sha1_sum html_attr_unescape
html_unescape humanize_bytes md5_bytes md5_sum),
- qw(monkey_patch network_contains punycode_decode punycode_encode quote
scope_guard secure_compare sha1_bytes),
- qw(sha1_sum slugify split_cookie_header split_header steady_time tablify
term_escape trim unindent unquote),
- qw(url_escape url_unescape xml_escape xor_encode)
+ qw(extract_usage getopt gunzip gzip header_params hmac_sha1_sum
html_attr_unescape html_unescape humanize_bytes),
+ qw(md5_bytes md5_sum monkey_patch network_contains punycode_decode
punycode_encode quote scope_guard secure_compare),
+ qw(sha1_bytes sha1_sum slugify split_cookie_header split_header steady_time
tablify term_escape trim unindent),
+ qw(unquote url_escape url_unescape xml_escape xor_encode)
);
# Aliases
@@ -162,6 +166,23 @@
return $compressed;
}
+sub header_params {
+ my $value = shift;
+
+ my $params = {};
+ while ($value =~ /\G[;\s]*([^=;, ]+)\s*/gc) {
+ my $name = $1;
+
+ # Quoted value
+ if ($value =~ /$QUOTED_VALUE_RE/gco) { $params->{$name} //= unquote($1) }
+
+ # Unquoted value
+ elsif ($value =~ /$UNQUOTED_VALUE_RE/gco) { $params->{$name} //= $1 }
+ }
+
+ return ($params, substr($value, pos($value) // 0));
+}
+
sub html_attr_unescape { _html(shift, 1) }
sub html_unescape { _html(shift, 0) }
@@ -450,10 +471,10 @@
if ($expires && $str =~ /\G=\s*$EXPIRES_RE/gco) { $part[-1] = $1 }
# Quoted value
- elsif ($str =~ /\G=\s*("(?:\\\\|\\"|[^"])*")/gc) { $part[-1] = unquote $1 }
+ elsif ($str =~ /$QUOTED_VALUE_RE/gco) { $part[-1] = unquote $1 }
# Unquoted value
- elsif ($str =~ /\G=\s*([^;, ]*)/gc) { $part[-1] = $1 }
+ elsif ($str =~ /$UNQUOTED_VALUE_RE/gco) { $part[-1] = $1 }
# Separator
next unless $str =~ /\G[;\s]*,\s*/gc;
@@ -692,6 +713,13 @@
Compress bytes with L<IO::Compress::Gzip>.
+=head2 header_params
+
+ my ($params, $remainder) = header_params 'one=foo; two="bar", three=baz';
+
+Extract HTTP header field parameters until the first comma according to L<RFC
5987|http://tools.ietf.org/html/rfc5987>.
+Note that this function is B<EXPERIMENTAL> and might change without warning!
+
=head2 hmac_sha1_sum
my $checksum = hmac_sha1_sum $bytes, 'passw0rd';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/lib/Mojolicious.pm
new/Mojolicious-9.30/lib/Mojolicious.pm
--- old/Mojolicious-9.28/lib/Mojolicious.pm 2022-09-12 13:10:01.000000000
+0200
+++ new/Mojolicious-9.30/lib/Mojolicious.pm 2022-11-11 11:15:58.000000000
+0100
@@ -57,7 +57,7 @@
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Waffle';
-our $VERSION = '9.28';
+our $VERSION = '9.30';
sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/t/mojo/headers.t
new/Mojolicious-9.30/t/mojo/headers.t
--- old/Mojolicious-9.28/t/mojo/headers.t 2022-06-14 13:31:51.000000000
+0200
+++ new/Mojolicious-9.30/t/mojo/headers.t 2022-11-23 01:14:03.000000000
+0100
@@ -260,6 +260,38 @@
is_deeply $headers->dehop->to_hash, {Server => 'pass'}, 'right structure';
};
+subtest 'Links' => sub {
+ my $headers = Mojo::Headers->new;
+ is_deeply $headers->links, {}, 'right structure';
+
+ $headers->link('</foo>; rel=foo, </bar>; rel=foo');
+ is_deeply $headers->links, {foo => {link => '/foo', rel => 'foo'}}, 'right
structure';
+
+ $headers->link('</foo>; rel=foo; title=bar');
+ is_deeply $headers->links, {foo => {link => '/foo', rel => 'foo', title =>
'bar'}}, 'right structure';
+
+ $headers->link('<http://example.com?foo=b;,ar>; rel=next, </>; rel=root;
title="foo bar"');
+ my $links = {
+ next => {link => 'http://example.com?foo=b;,ar', rel => 'next'},
+ root => {link => '/', rel => 'root', title => 'foo bar'}
+ };
+ is_deeply $headers->links, $links, 'right structure';
+
+ is_deeply $headers->link('</foo>')->links, {}, 'right
structure';
+ is_deeply $headers->link('</foo>;')->links, {}, 'right
structure';
+ is_deeply $headers->link('</foo>; test=failed')->links, {}, 'right
structure';
+ is_deeply $headers->link('test=failed')->links, {}, 'right
structure';
+
+ $headers->links({next => '/foo', prev => '/bar'});
+ is_deeply $headers->to_hash, {Link => '</foo>; rel="next", </bar>;
rel="prev"'}, 'right structure';
+
+ $headers->links({next => '/foo?bar'});
+ is_deeply $headers->to_hash, {Link => '</foo?bar>; rel="next"'}, 'right
structure';
+
+ $headers->links({next => '/foo?ba;,r'});
+ is_deeply $headers->to_hash, {Link => '</foo?ba;,r>; rel="next"'}, 'right
structure';
+};
+
subtest 'Invalid characters' => sub {
my $headers = Mojo::Headers->new;
eval { $headers->add(Foo => "test\x0a") };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/t/mojo/promise_async_await.t
new/Mojolicious-9.30/t/mojo/promise_async_await.t
--- old/Mojolicious-9.28/t/mojo/promise_async_await.t 2022-10-14
20:52:39.000000000 +0200
+++ new/Mojolicious-9.30/t/mojo/promise_async_await.t 2022-10-31
14:36:40.000000000 +0100
@@ -79,6 +79,11 @@
my $ua = Mojo::UserAgent->new(ioloop => Mojo::IOLoop->singleton);
+async sub await_then_return_promise {
+ my $method = shift;
+ return Mojo::Promise->resolve(await Mojo::Promise->$method(0.01, $method));
+}
+
async sub reject_p {
await Mojo::Promise->reject('Rejected promise');
}
@@ -136,12 +141,12 @@
my ($error, @warn);
local $SIG{__WARN__} = sub { push @warn, $_[0] };
reject_p()->catch(sub { $error = shift })->wait;
- like $error, qr{^Rejected promise at}, 'right content';
+ like $error, qr/^Rejected promise at/, 'right content';
is @warn, 0, 'no waring';
@warn = ();
reject_p()->wait;
- like "@warn", qr{Unhandled rejected promise}, 'unhandled promise';
+ like "@warn", qr/Unhandled rejected promise/, 'unhandled promise';
};
subtest 'Runaway exception' => sub {
@@ -157,6 +162,15 @@
is $text, 'value', 'right content';
};
+subtest 'Async nested function returning a promise' => sub {
+ my $res;
+ await_then_return_promise('timer')->then(sub { $res = shift })->catch(sub {
$res = shift })->wait;
+ is $res, 'timer', 'right content';
+
+ await_then_return_promise('timeout')->then(sub { $res = shift })->catch(sub
{ $res = shift })->wait;
+ like $res, qr/^timeout at/, 'right content';
+};
+
subtest 'Async WebSocket' => sub {
$t->websocket_ok('/six')->send_ok('test')->message_ok->message_is('One: test
Two: test')->finish_ok;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojolicious-9.28/t/mojo/util.t
new/Mojolicious-9.30/t/mojo/util.t
--- old/Mojolicious-9.28/t/mojo/util.t 2022-06-14 13:31:51.000000000 +0200
+++ new/Mojolicious-9.30/t/mojo/util.t 2022-11-23 01:20:31.000000000 +0100
@@ -9,10 +9,10 @@
use Sub::Util qw(subname);
use Mojo::Util qw(b64_decode b64_encode camelize class_to_file class_to_path
decamelize decode dumper encode),
- qw(extract_usage getopt gunzip gzip hmac_sha1_sum html_unescape
html_attr_unescape humanize_bytes md5_bytes md5_sum),
- qw(monkey_patch network_contains punycode_decode punycode_encode quote
scope_guard secure_compare sha1_bytes),
- qw(sha1_sum slugify split_cookie_header split_header steady_time tablify
term_escape trim unindent unquote),
- qw(url_escape url_unescape xml_escape xor_encode);
+ qw(extract_usage getopt gunzip gzip header_params hmac_sha1_sum
html_unescape html_attr_unescape humanize_bytes),
+ qw(md5_bytes md5_sum monkey_patch network_contains punycode_decode
punycode_encode quote scope_guard secure_compare),
+ qw(sha1_bytes sha1_sum slugify split_cookie_header split_header steady_time
tablify term_escape trim unindent),
+ qw(unquote url_escape url_unescape xml_escape xor_encode);
subtest 'camelize' => sub {
is camelize('foo_bar_baz'), 'FooBarBaz', 'right camelized result';
@@ -94,6 +94,18 @@
is_deeply split_cookie_header($header), $tree, 'right result';
};
+subtest 'header_params' => sub {
+ is_deeply [header_params('')], [{}, ''], 'right result';
+ is_deeply [header_params('foo=b=a=r')], [{foo => 'b=a=r'}, ''],
'right result';
+ is_deeply [header_params('a=b; c, d=e')], [{a => 'b'}, ', d=e'],
'right result';
+ is_deeply [header_params('a=b; a=c')], [{a => 'b'}, ''],
'right result';
+ is_deeply [header_params('a=b; a="c"')], [{a => 'b'}, ''],
'right result';
+ is_deeply [header_params('a=b; b="c=d"')], [{a => 'b', b => 'c=d'}, ''],
'right result';
+ is_deeply [header_params('a=b, c=d')], [{a => 'b'}, ', c=d'], 'right
result';
+ is_deeply [header_params(q{rel="x"; t*=UTF-8'de'a%20b})], [{rel => 'x', 't*'
=> "UTF-8'de'a%20b"}, ''],
+ 'right result';
+};
+
subtest 'extract_usage' => sub {
is extract_usage, "extract_usage
test!\n", 'right result';
is extract_usage(curfile->sibling('lib', 'myapp.pl')), "USAGE: myapp.pl
daemon\n\n test\n123\n", 'right result';