Bug#694537: libio-prompt-perl: Version of IO::Prompt in wheezy dies if you call prompt() in non-main package

2012-11-27 Thread Michael Howe
Package: libio-prompt-perl
Version: 0.997001-1
Severity: important

Hello,

The version of IO::Prompt in wheezy (0.997001-1) is affected by
https://rt.cpan.org/Public/Bug/Display.html?id=69084 which makes it
unusable for any code that calls prompt() that isn't in the main
package (hence the severity of this bug report).

A very basic script to demonstrate this issue:

---8---
#!/usr/bin/perl
use strict;
use warnings;

package Test;
use IO::Prompt;

sub testprompt {
prompt This is a test;
}

package main;

use Test;

Test::testprompt;
---8---

Which dies with the error 'Can't call method opened without a package
or object reference at /usr/share/perl5/IO/Prompt.pm line 188.'.

The version in unstable (0.997002-1) appears to contain the fix for this
issue, but as far as I can tell there's no pending unblock request
(apologies for the noise if there is and I've just missed it).

I'm aware that upstream recommend moving to libio-prompter-perl instead,
but that will first appear in wheezy, which doesn't give much overlap
time in which to convert scripts.

Many thanks,

Michael

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libio-prompt-perl depends on:
ii  libterm-readkey-perl2.30-4+b2
ii  libwant-perl0.21-1
ii  perl5.14.2-15
ii  perl-modules [libversion-perl]  5.14.2-15

libio-prompt-perl recommends no packages.

libio-prompt-perl suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#694537: libio-prompt-perl: Version of IO::Prompt in wheezy dies if you call prompt() in non-main package

2012-11-27 Thread Salvatore Bonaccorso
Control: tags -1 + pending confirmed

Hi Michael

I did the upload for 0.997002-1 and missed that this was quite
critical. I'm sorry for that. I will prepare a version to upload to
tpu only fixing this issiue.

This is bad, as I missed that, I also had some packaging changes done,
which unfit for the unblock of the unstable version.

Regards,
Salvatore


signature.asc
Description: Digital signature


Bug#694537: libio-prompt-perl: Version of IO::Prompt in wheezy dies if you call prompt() in non-main package

2012-11-27 Thread Salvatore Bonaccorso
Control: tags -1 + patch

Attached is the proposed debdiff for the t-p-u.

Regards,
Salvatore
diff -Nru libio-prompt-perl-0.997001/debian/changelog 
libio-prompt-perl-0.997001/debian/changelog
--- libio-prompt-perl-0.997001/debian/changelog 2010-04-25 18:06:43.0 
+0200
+++ libio-prompt-perl-0.997001/debian/changelog 2012-11-27 14:55:17.0 
+0100
@@ -1,3 +1,14 @@
+libio-prompt-perl (0.997001-1+deb7u1) testing-proposed-updates; urgency=low
+
+  * Add 694537-use-Scalar-Util-openhandle.patch patch.
+IO::Prompt doesn't work on perl (= 5.14) if prompt() is called in
+non-main package with 'Can't call method opened without a package
+or object reference at /usr/share/perl5/IO/Prompt.pm line 188.'.
+Thanks to Michael Howe michael.h...@it.ox.ac.uk (Closes: #694537)
+  * Email change: Salvatore Bonaccorso - car...@debian.org
+
+ -- Salvatore Bonaccorso car...@debian.org  Tue, 27 Nov 2012 14:54:29 +0100
+
 libio-prompt-perl (0.997001-1) unstable; urgency=low
 
   * New upstream release
diff -Nru libio-prompt-perl-0.997001/debian/control 
libio-prompt-perl-0.997001/debian/control
--- libio-prompt-perl-0.997001/debian/control   2010-04-25 18:06:43.0 
+0200
+++ libio-prompt-perl-0.997001/debian/control   2012-11-27 14:55:17.0 
+0100
@@ -7,7 +7,7 @@
 Maintainer: Debian Perl Group pkg-perl-maintain...@lists.alioth.debian.org
 Uploaders: gregor herrmann gre...@debian.org, Jonathan Yu jaw...@cpan.org,
  Gunnar Wolf gw...@debian.org, Niko Tyni nt...@iki.fi,
- Salvatore Bonaccorso salvatore.bonacco...@gmail.com
+ Salvatore Bonaccorso car...@debian.org
 Standards-Version: 3.8.4
 Homepage: http://search.cpan.org/dist/IO-Prompt/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libio-prompt-perl/
diff -Nru libio-prompt-perl-0.997001/debian/copyright 
libio-prompt-perl-0.997001/debian/copyright
--- libio-prompt-perl-0.997001/debian/copyright 2010-04-25 18:06:43.0 
+0200
+++ libio-prompt-perl-0.997001/debian/copyright 2012-11-27 14:55:17.0 
+0100
@@ -12,7 +12,7 @@
  2006, Gunnar Wolf gw...@debian.org
  2006, Niko Tyni nt...@iki.fi
  2010, Jonathan Yu jaw...@cpan.org
- 2010, Salvatore Bonaccorso salvatore.bonacco...@gmail.com
+ 2010, Salvatore Bonaccorso car...@debian.org
 License: Artistic or GPL-1+
 
 License: Artistic
diff -Nru libio-prompt-perl-0.997001/debian/gbp.conf 
libio-prompt-perl-0.997001/debian/gbp.conf
--- libio-prompt-perl-0.997001/debian/gbp.conf  1970-01-01 01:00:00.0 
+0100
+++ libio-prompt-perl-0.997001/debian/gbp.conf  2012-11-27 14:55:17.0 
+0100
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch = wheezy
diff -Nru 
libio-prompt-perl-0.997001/debian/patches/694537-use-Scalar-Util-openhandle.patch
 
libio-prompt-perl-0.997001/debian/patches/694537-use-Scalar-Util-openhandle.patch
--- 
libio-prompt-perl-0.997001/debian/patches/694537-use-Scalar-Util-openhandle.patch
   1970-01-01 01:00:00.0 +0100
+++ 
libio-prompt-perl-0.997001/debian/patches/694537-use-Scalar-Util-openhandle.patch
   2012-11-27 14:55:17.0 +0100
@@ -0,0 +1,23 @@
+Description: Doesn't work on 5.14 if you call prompt() in non-main package
+Origin: upstream, 
https://metacpan.org/diff/file/?target=DCONWAY/IO-Prompt-0.997002/lib/IO/Prompt.pmsource=DCONWAY/IO-Prompt-0.997001/lib/IO/Prompt.pm
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=69084
+Bug-Debian: http://bugs.debian.org/694537
+Forwarded: not-needed
+Author: Salvatore Bonaccorso car...@debian.org
+Last-Update: 2012-11-27
+Applied-Upstream: yes
+
+--- a/lib/IO/Prompt.pm
 b/lib/IO/Prompt.pm
+@@ -183,9 +183,10 @@
+ open $IN, /dev/tty or croak Cannot read from terminal: $!;
+ }
+ else {
++use Scalar::Util;
+ no strict 'refs';
+ my $ARGV = $caller . ::ARGV;
+-unless (*$ARGV-opened) {
++unless (Scalar::Util::openhandle(*$ARGV)) {
+ $$ARGV = shift(@$ARGV) || '-';
+ open $ARGV or croak Can't open $$ARGV: $!;
+ }
diff -Nru libio-prompt-perl-0.997001/debian/patches/series 
libio-prompt-perl-0.997001/debian/patches/series
--- libio-prompt-perl-0.997001/debian/patches/series2010-04-25 
18:06:43.0 +0200
+++ libio-prompt-perl-0.997001/debian/patches/series2012-11-27 
14:55:17.0 +0100
@@ -1,2 +1,3 @@
 create-pty.patch
 add-shebang-to-examples.patch
+694537-use-Scalar-Util-openhandle.patch


signature.asc
Description: Digital signature