From bae230a5adde819650820ccaca88b84f46a877f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Fri, 5 May 2017 15:00:04 +0200
Subject: Adapt to Mojolicious-7.31

---
 ...replacement-for-Mojo-Message-Response-is_.patch | 52 ++++++++++++++++++++++
 perl-MojoX-JSON-RPC.spec                           | 13 +++++-
 2 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 
MojoX-JSON-RPC-0.10-Use-modern-replacement-for-Mojo-Message-Response-is_.patch

diff --git 
a/MojoX-JSON-RPC-0.10-Use-modern-replacement-for-Mojo-Message-Response-is_.patch
 
b/MojoX-JSON-RPC-0.10-Use-modern-replacement-for-Mojo-Message-Response-is_.patch
new file mode 100644
index 0000000..d50fdc3
--- /dev/null
+++ 
b/MojoX-JSON-RPC-0.10-Use-modern-replacement-for-Mojo-Message-Response-is_.patch
@@ -0,0 +1,52 @@
+From b585f7c15b024bda49037e3a09e9a96f770eb151 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
+Date: Fri, 5 May 2017 14:54:06 +0200
+Subject: [PATCH] Use modern replacement for
+ Mojo::Message::Response::is_success()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Mojilicious 7.13 deprecated Mojo::Message::Response::is_success() and
+7.31 removed it. Thus tests fail now.
+
+This patch replaces the is_success() calls with their modern
+replacements.
+
+CPAN RT#121395
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ Makefile.PL                  | 2 +-
+ lib/MojoX/JSON/RPC/Client.pm | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 4adb6ac..4d6a7bc 100755
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -12,7 +12,7 @@ WriteMakefile(
+     VERSION_FROM => 'lib/MojoX/JSON/RPC.pm',
+     ABSTRACT     => 'Perl implementation of JSON-RPC 2.0 protocol for 
Mojolicious',
+     AUTHOR       => 'Henry Tang <henry...@gmail.com>',
+-    PREREQ_PM    => { 'Mojolicious' => '5.77' },
++    PREREQ_PM    => { 'Mojolicious' => '7.13' },
+     LICENSE      => 'artistic_2',
+     test         => { TESTS => 't/*.t t/*/*.t t/*/*/*.t' },
+     META_MERGE => {
+diff --git a/lib/MojoX/JSON/RPC/Client.pm b/lib/MojoX/JSON/RPC/Client.pm
+index ef47b2b..f8fbbff 100644
+--- a/lib/MojoX/JSON/RPC/Client.pm
++++ b/lib/MojoX/JSON/RPC/Client.pm
+@@ -108,7 +108,7 @@ sub _process_result {
+     }
+ 
+     # Check if RPC call is succesfull
+-    if ( !( $tx_res->is_status_class(200) || $tx_res->is_status_class(400) ) )
++    if ( !( $tx_res->is_success || $tx_res->is_client_error ) )
+     {
+         return;
+     }
+-- 
+2.9.3
+
diff --git a/perl-MojoX-JSON-RPC.spec b/perl-MojoX-JSON-RPC.spec
index 1a7fa14..33bb44e 100644
--- a/perl-MojoX-JSON-RPC.spec
+++ b/perl-MojoX-JSON-RPC.spec
@@ -1,11 +1,13 @@
 Name:           perl-MojoX-JSON-RPC
 Version:        0.10
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Perl implementation of JSON-RPC 2.0 protocol for Mojolicious
 License:        Artistic 2.0
 
 URL:            http://search.cpan.org/dist/MojoX-JSON-RPC/
 Source0:        
http://www.cpan.org/authors/id/H/HE/HENRYYKT/MojoX-JSON-RPC-%{version}.tar.gz
+# Adapt to Mojolicious-7.31, bug #1447528, CPAN RT#121395
+Patch0:         
MojoX-JSON-RPC-0.10-Use-modern-replacement-for-Mojo-Message-Response-is_.patch
 
 BuildArch:      noarch
 BuildRequires:  perl
@@ -18,13 +20,16 @@ BuildRequires:  perl(lib)
 BuildRequires:  perl(Mojo::Base)
 BuildRequires:  perl(Mojo::JSON)
 BuildRequires:  perl(Mojo::UserAgent)
-BuildRequires:  perl(Mojolicious::Lite) >= 5.77
+# Mojolicious is the only versioned module
+BuildRequires:  perl(Mojolicious) >= 7.13
 BuildRequires:  perl(Test::Mojo)
 BuildRequires:  perl(Test::More)
 BuildRequires:  perl(strict)
 BuildRequires:  perl(warnings)
 
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo 
$version))
+# Mojolicious is the only versioned module
+Requires:       perl(Mojolicious) >= 7.13
 
 %{?perl_default_filter}
 
@@ -34,6 +39,7 @@ with Mojolicious.
 
 %prep
 %setup -q -n MojoX-JSON-RPC-%{version}
+%patch0 -p1
 
 %build
 %{__perl} Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1
@@ -56,6 +62,9 @@ make test
 %{_mandir}/man3/Mojolicious::Plugin::JsonRpcDispatcher.3pm.gz
 
 %changelog
+* Fri May 05 2017 Petr Pisar <ppi...@redhat.com> - 0.10-3
+- Adapt to Mojolicious-7.31 (bug #1447528)
+
 * Sat Feb 11 2017 Fedora Release Engineering <rel...@fedoraproject.org> - 
0.10-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
 
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-MojoX-JSON-RPC.git/commit/?h=master&id=bae230a5adde819650820ccaca88b84f46a877f2
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to