Skip Menu |

This queue is for tickets about the Expect CPAN distribution.

Report information
The Basics
Id: 21723
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: Expect

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.20
Fixed in: (no value)



Subject: failing tests in bleadperl; multiline match in test 38 required; patch provided
I believe it was a bug in older perls that the test 38 succeeded. Fact is since patch #23471 to bleadperl this test fails and the attached patch fixes this. I have taken the freedom to also drastically reduce the number of imported symbols for the sake of less potential clashes and for overall memory economy. Feel free to reject this part of the patch, it seemed like a low hanging fruit to me when I peeked into Expect.pm. The patch is tested on linux only on 5.6.2, 5.8.0, 5.8.3, 5.8.7, 5.8.8 and on several bleadperls before and after patch #23471.
Subject: patch-expect-120.txt
# This is a patch for Expect-1.20 to update it to Expect-1.20-ak # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -u 'Expect-1.20/Expect.pm' 'Expect-1.20-ak/Expect.pm' Index: ./Expect.pm --- ./Expect.pm Fri Jul 21 13:23:47 2006 +++ ./Expect.pm Tue Sep 26 08:01:35 2006 @@ -25,11 +25,11 @@ use strict 'refs'; use strict 'vars'; use strict 'subs'; -use POSIX; # For setsid. -use Fcntl; # For checking file handle settings. +use POSIX qw(:sys_wait_h :unistd_h); # For WNOHANG and isatty +use Fcntl qw(:DEFAULT); # For checking file handle settings. use Carp qw(cluck croak carp confess); -use IO::Handle; -use Exporter; +use IO::Handle (); +use Exporter (); # This is necessary to make routines within Expect work. @@ -107,7 +107,7 @@ TO_PARENT->autoflush(1); TO_CHILD->autoflush(1); eval { - fcntl(TO_PARENT, F_SETFD, FD_CLOEXEC); + fcntl(TO_PARENT, Fcntl::F_SETFD, Fcntl::FD_CLOEXEC); }; my $pid = fork; @@ -861,7 +861,7 @@ } # is it dead? if (defined(${*$exp}{exp_Pid})) { - my $ret = waitpid(${*$exp}{exp_Pid}, WNOHANG); + my $ret = waitpid(${*$exp}{exp_Pid}, POSIX::WNOHANG); if ($ret == ${*$exp}{exp_Pid}) { printf STDERR ("%s: exit(0x%02X)\r\n", ${*$exp}{exp_Pty_Handle}, $?) diff -u 'Expect-1.20/test.pl' 'Expect-1.20-ak/test.pl' Index: ./test.pl --- ./test.pl Wed Jul 19 12:31:44 2006 +++ ./test.pl Tue Sep 26 07:21:14 2006 @@ -293,7 +293,7 @@ $exp->log_file(undef); exp_continue; } ], - [ qr/^uc:\s*(\w+)/, sub { + [ qr/(?m:^uc:\s*(\w+))/, sub { my $self = shift; my ($s) = $self->matchlist; chomp $s; #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Tue Sep 26 08:22:02 2006 # Generated by : makepatch 2.00_12* # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # p 'Expect.pm' 54217 1159250495 0100644 # p 'test.pl' 11469 1159248074 0100644 #### End of ApplyPatch data #### #### End of Patch kit [created: Tue Sep 26 08:22:02 2006] #### #### Patch checksum: 86 2831 52060 #### #### Checksum: 104 3517 43226 ####
Will be fixed in v1.21 -- RGiersig@cpan.org