From 2e32e0f6f993f6cedfb63026c677c26a69573fe5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Wed, 23 Sep 2015 12:30:17 +0200
Subject: Port Propagete-PerlIO_return_value_from_STORE.patch to 1.27 properly


diff --git 
a/Term-ReadLine-Gnu-1.26-Propagete-PerlIO_return_value_from_STORE.patch 
b/Term-ReadLine-Gnu-1.26-Propagete-PerlIO_return_value_from_STORE.patch
deleted file mode 100644
index 8daf3bb..0000000
--- a/Term-ReadLine-Gnu-1.26-Propagete-PerlIO_return_value_from_STORE.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- Gnu.pm.orig
-+++ Gnu.pm
-@@ -734,9 +734,8 @@ sub STORE {
-     } elsif ($type eq 'F') {
-       return _rl_store_function($value, $id);
-     } elsif ($type eq 'IO') {
--      my $FH = $value;
-       # Pass filehandles to the GNU Readline Library
--      _rl_store_iostream($value, $id);
-+      my $FH = _rl_store_iostream($value, $id);
-       # pop stdio layer pushed by PerlIO_findFILE().
-       # https://rt.cpan.org/Ticket/Display.html?id=59832
-       my @layers = PerlIO::get_layers($FH);
---- ./Gnu.xs.orig
-+++ ./Gnu.xs
-@@ -3147,7 +3147,7 @@ _rl_fetch_int(id)
-         }
-       }
- 
--void
-+PerlIO *
- _rl_store_iostream(stream, id)
-       PerlIO *stream
-       int id
-@@ -3157,9 +3157,11 @@ _rl_store_iostream(stream, id)
-         switch (id) {
-         case 0:
-           rl_instream = PerlIO_findFILE(stream);
-+          RETVAL = stream;
-           break;
-         case 1:
-           rl_outstream = PerlIO_findFILE(stream);
-+          RETVAL = stream;
- #ifdef __CYGWIN__
-           {
-             /* Cygwin b20.1 library converts NL to CR-NL
-@@ -3176,10 +3178,11 @@ _rl_store_iostream(stream, id)
-           break;
-         default:
-           warn("Gnu.xs:_rl_store_iostream: Illegal `id' value: `%d'", id);
-+          XSRETURN_UNDEF;
-           break;
-         }
-         PerlIO_debug("TRG:store_iostream id %d fd %d\n",
--                     id, PerlIO_fileno(stream));
-+                     id, PerlIO_fileno(RETVAL));
-       }
- 
- #if 0 /* not used since 1.26 */
diff --git 
a/Term-ReadLine-Gnu-1.27-Propagete-PerlIO_return_value_from_STORE.patch 
b/Term-ReadLine-Gnu-1.27-Propagete-PerlIO_return_value_from_STORE.patch
new file mode 100644
index 0000000..1143efb
--- /dev/null
+++ b/Term-ReadLine-Gnu-1.27-Propagete-PerlIO_return_value_from_STORE.patch
@@ -0,0 +1,89 @@
+From a70e0540b53a137a8b30cd4c2426c33e2c8e9720 Mon Sep 17 00:00:00 2001
+From: HAYASHI <haya...@cpan.org>
+Date: Wed, 23 Sep 2015 12:22:23 +0200
+Subject: [PATCH] Propagete PerlIO return value from STORE
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On Thu, 12 Feb 2015 14:52:48 GMT, ppisar wrote:
+> Dne Čt 12.úno.2015 09:51:59, ppisar napsal(a):
+> > I found this change causing a dead-lock in Debug-Client-0.29 tests
+> > (see <https://github.com/PadreIDE/Debug-Client/issues/1>). I don't
+> > know which party is more guilty, but I observe that perl debugger does
+> > not emit "DB<1>" prompt if it is run from the Debug-Client's test, so
+> > it does not process client "c" command and everything halts.
+>
+> I should note that I use perl 5.20.1.
+
+Here is a fix.  I don't know why 1.26 fails or why this works.
+
+Petr Pisar: Patch for 1.26 ported to 1.27.
+
+CPAN RT#101078
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ Gnu.pm | 3 +--
+ Gnu.xs | 9 +++++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/Gnu.pm b/Gnu.pm
+index 4701589..298d567 100644
+--- a/Gnu.pm
++++ b/Gnu.pm
+@@ -734,9 +734,8 @@ sub STORE {
+     } elsif ($type eq 'F') {
+       return _rl_store_function($value, $id);
+     } elsif ($type eq 'IO') {
+-      my $FH = $value;
+       # Pass filehandles to the GNU Readline Library
+-      _rl_store_iostream($value, $id);
++      my $FH = _rl_store_iostream($value, $id);
+       # pop stdio layer pushed by PerlIO_findFILE().
+       # https://rt.cpan.org/Ticket/Display.html?id=59832
+       my @layers = PerlIO::get_layers($FH);
+diff --git a/Gnu.xs b/Gnu.xs
+index cb91a2c..5bf0845 100644
+--- a/Gnu.xs
++++ b/Gnu.xs
+@@ -3147,7 +3147,7 @@ _rl_fetch_int(id)
+         }
+       }
+ 
+-void
++PerlIO *
+ _rl_store_iostream(stream, id)
+       PerlIO *stream
+       int id
+@@ -3157,9 +3157,11 @@ _rl_store_iostream(stream, id)
+         switch (id) {
+         case 0:
+           rl_instream = PerlIO_findFILE(stream);
++          RETVAL = stream;
+           break;
+         case 1:
+           rl_outstream = PerlIO_findFILE(stream);
++          RETVAL = stream;
+ #ifdef __CYGWIN__
+           {
+             /* Cygwin b20.1 library converts NL to CR-NL
+@@ -3176,11 +3178,14 @@ _rl_store_iostream(stream, id)
+           break;
+         default:
+           warn("Gnu.xs:_rl_store_iostream: Illegal `id' value: `%d'", id);
++          XSRETURN_UNDEF;
+           break;
+         }
+         PerlIO_debug("TRG:store_iostream id %d fd %d\n",
+-                     id, PerlIO_fileno(stream));
++                     id, PerlIO_fileno(RETVAL));
+       }
++     OUTPUT:
++      RETVAL
+ 
+ #if 0 /* not used since 1.26 */
+ 
+-- 
+2.4.3
+
diff --git a/perl-Term-ReadLine-Gnu.spec b/perl-Term-ReadLine-Gnu.spec
index 52f2271..c074fed 100644
--- a/perl-Term-ReadLine-Gnu.spec
+++ b/perl-Term-ReadLine-Gnu.spec
@@ -1,11 +1,12 @@
 Name:           perl-Term-ReadLine-Gnu
 Version:        1.27
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Perl extension for the GNU Readline/History Library
 License:        GPL+ or Artistic
 URL:            http://search.cpan.org/dist/Term-ReadLine-Gnu/
 Source0:        
http://www.cpan.org/authors/id/H/HA/HAYASHI/Term-ReadLine-Gnu-%{version}.tar.gz
-Patch0:         
Term-ReadLine-Gnu-1.26-Propagete-PerlIO_return_value_from_STORE.patch
+# Fix regression with Debug::Client, bugs #1189459, #1264742, CPAN RT#101078
+Patch0:         
Term-ReadLine-Gnu-1.27-Propagete-PerlIO_return_value_from_STORE.patch
 BuildRequires:  perl(ExtUtils::MakeMaker)
 BuildRequires:  ncurses-devel
 BuildRequires:  readline-devel >= 2.1
@@ -21,7 +22,7 @@ An implementation of Term::ReadLine using the GNU 
Readline/History Library.
 
 %prep
 %setup -q -n Term-ReadLine-Gnu-%{version}
-%patch0
+%patch0 -p1
 
 %build
 # Fix permissions and shebang paths at one shot
@@ -60,6 +61,10 @@ expect -c '
 
 
 %changelog
+* Wed Sep 23 2015 Petr Pisar <ppi...@redhat.com> - 1.27-3
+- Port Propagete-PerlIO_return_value_from_STORE.patch to 1.27 properly
+  (bug #1264742)
+
 * Wed Sep 09 2015 Emmanuel Seyman <emman...@seyman.fr> - 1.27-2
 - Re-add patch that was in fact not upstreamed
 
-- 
cgit v0.10.2


        
http://pkgs.fedoraproject.org/cgit/perl-Term-ReadLine-Gnu.git/commit/?h=master&id=2e32e0f6f993f6cedfb63026c677c26a69573fe5
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/perl-devel

Reply via email to