Hello community,
here is the log from the commit of package perl-Expect
checked in at Fri Jul 14 13:29:08 CEST 2006.
--------
--- perl-Expect/perl-Expect.changes 2006-01-25 21:39:40.000000000 +0100
+++ perl-Expect/perl-Expect.changes 2006-07-14 12:27:42.000000000 +0200
@@ -1,0 +2,10 @@
+Fri Jul 14 12:13:21 CEST 2006 - mc@suse.de
+
+- Version 1.18
+ - added param check for expect()
+ - added another pipe to synchronize spawning. Closing the slave in
+ the parent can lead to a hang if the child already wrote
+ something into it...
+ - some bugfixes
+
+-------------------------------------------------------------------
Old:
----
Expect-1.15.tar.gz
New:
----
Expect-1.18.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Expect.spec ++++++
--- /var/tmp/diff_new_pack.cswxMt/_old 2006-07-14 13:28:56.000000000 +0200
+++ /var/tmp/diff_new_pack.cswxMt/_new 2006-07-14 13:28:56.000000000 +0200
@@ -1,11 +1,11 @@
#
-# spec file for package perl-Expect (Version 1.15)
+# spec file for package perl-Expect (Version 1.18)
#
-# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://www.suse.de/feedback/
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
@@ -19,8 +19,8 @@
Requires: perl = %{perl_version}
Autoreqprov: on
Summary: Expect for perl
-Version: 1.15
-Release: 298
+Version: 1.18
+Release: 1
Source: Expect-%{version}.tar.gz
Patch: Expect.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -62,6 +62,13 @@
/var/adm/perl-modules/perl-Expect
%changelog -n perl-Expect
+* Fri Jul 14 2006 - mc@suse.de
+- Version 1.18
+- added param check for expect()
+- added another pipe to synchronize spawning. Closing the slave in
+ the parent can lead to a hang if the child already wrote
+ something into it...
+- some bugfixes
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Thu Sep 29 2005 - dmueller@suse.de
++++++ Expect-1.15.tar.gz -> Expect-1.18.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/Changes new/Expect-1.18/Changes
--- old/Expect-1.15/Changes 2002-03-19 12:54:04.000000000 +0100
+++ new/Expect-1.18/Changes 2006-07-11 15:34:06.000000000 +0200
@@ -240,6 +240,33 @@
to exp_New_Data not set.
+Expect v1.16
+============
+! fixed hangup with pipe sync upon spawn by adding close-on-exec to pipe handle
+! fixed log_file(undef) when logging to CODE ref
+! fixed $? mangling in DESTROY by saving & restoring status
+
+! fixed hangup in send_slow
+
+! fixed ugly solaris hack by disabling it for raw ptys
+
++ added param check for expect()
+
+
+Expect v1.17
+============
+
+! fixed param check for expect() to allow expect(undef) et al
+
+
+Expect v1.18
+============
+
+! added another pipe to synchronize spawning. Closing the slave in the
+ parent can lead to a hang if the child already wrote something into
+ it...
+
+! fixed REs in test to deal with shell prompts
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/Expect.pm new/Expect-1.18/Expect.pm
--- old/Expect-1.15/Expect.pm 2002-03-19 12:59:29.000000000 +0100
+++ new/Expect-1.18/Expect.pm 2006-07-11 15:31:07.000000000 +0200
@@ -1,4 +1,4 @@
-#
+# -*-cperl-*-
# Please see the .pod files for documentation. This module is copyrighted
# as per the usual perl legalese:
# Copyright (c) 1997 Austin Schutz.
@@ -15,11 +15,11 @@
# Roland Giersig
#
-use 5; # 4 won't cut it.
+use 5.006; # 4 won't cut it.
package Expect;
-use IO::Pty 0.97; # We need make_slave_controlling_terminal()
+use IO::Pty 1.03; # We need make_slave_controlling_terminal()
use IO::Tty;
use strict 'refs';
@@ -37,7 +37,7 @@
@Expect::EXPORT = qw(expect exp_continue exp_continue_timeout);
BEGIN {
- $Expect::VERSION = 1.15;
+ $Expect::VERSION = 1.18;
# These are defaults which may be changed per object, or set as
# the user wishes.
# This will be unset, since the default behavior differs between
@@ -102,8 +102,13 @@
${*$self}{"exp_Command"} = \@cmd;
# set up pipe to detect childs exec error
- pipe(STAT_RDR, STAT_WTR) or die "Cannot open pipe: $!";
- STAT_WTR->autoflush(1);
+ pipe(FROM_CHILD, TO_PARENT) or die "Cannot open pipe: $!";
+ pipe(FROM_PARENT, TO_CHILD) or die "Cannot open pipe: $!";
+ TO_PARENT->autoflush(1);
+ TO_CHILD->autoflush(1);
+ eval {
+ fcntl(TO_PARENT, F_SETFD, FD_CLOEXEC);
+ };
my $pid = fork;
@@ -116,14 +121,16 @@
# parent
my $errno;
${*$self}{exp_Pid} = $pid;
- close STAT_WTR;
+ close TO_PARENT;
+ close FROM_PARENT;
$self->close_slave();
$self->set_raw() if $self->raw_pty and isatty($self);
+ close TO_CHILD; # so child gets EOF and can go ahead
# now wait for child exec (eof due to close-on-exit) or exec error
- my $errstatus = sysread(STAT_RDR, $errno, 256);
+ my $errstatus = sysread(FROM_CHILD, $errno, 256);
die "Cannot sync with child: $!" if not defined $errstatus;
- close STAT_RDR;
+ close FROM_CHILD;
if ($errstatus) {
$! = $errno+0;
warn "Cannot exec(@cmd): $!\n" if $^W;
@@ -132,7 +139,8 @@
}
else {
# child
- close STAT_RDR;
+ close FROM_CHILD;
+ close TO_CHILD;
$self->make_slave_controlling_terminal();
my $slv = $self->slave()
@@ -140,6 +148,13 @@
$slv->set_raw() if $self->raw_pty;
close($self);
+
+ # wait for parent before we detach
+ my $buffer;
+ my $errstatus = sysread(FROM_PARENT, $buffer, 256);
+ die "Cannot sync with parent: $!" if not defined $errstatus;
+ close FROM_PARENT;
+
close(STDIN);
open(STDIN,"<&". $slv->fileno())
or die "Couldn't reopen STDIN for reading, $!\n";
@@ -151,7 +166,7 @@
or die "Couldn't reopen STDERR for writing, $!\n";
{ exec(@cmd) };
- print STAT_WTR $!+0;
+ print TO_PARENT $!+0;
die "Cannot exec(@cmd): $!\n";
}
@@ -336,8 +351,8 @@
if (${*$self}{exp_Log_File} and ref(${*$self}{exp_Log_File}) ne 'CODE') {
close(${*$self}{exp_Log_File});
- ${*$self}{exp_Log_File} = undef;
}
+ ${*$self}{exp_Log_File} = undef;
return if (not $file);
my $fh = $file;
if (not ref($file)) {
@@ -427,6 +442,7 @@
my $self;
$self = shift if (ref($_[0]) and $_[0]->isa('Expect'));
shift if defined $_[0] and $_[0] eq 'Expect'; # or as Expect->expect
+ croak "expect(): not enough arguments, should be expect(timeout, [patterns...])" if @_ < 1;
my $timeout = shift;
my $timeout_hook = undef;
@@ -858,7 +874,7 @@
# ugly hack for broken solaris ttys that spew <blank><backspace>
# into our pretty output
- $buffer =~ s/ \cH//g;
+ $buffer =~ s/ \cH//g if not ${*$exp}{exp_Raw_Pty};
# Append it to the accumulator.
${*$exp}{exp_Accum} .= $buffer;
if (exists ${*$exp}{exp_Max_Accum}
@@ -1255,7 +1271,8 @@
# .01 sec granularity should work. If we miss something it will
# probably get flushed later, maybe in an expect call.
while (select($rmask,undef,undef,.01)) {
- sysread($self,${*$self}{exp_Pty_Buffer},1024);
+ my $ret = sysread($self,${*$self}{exp_Pty_Buffer},1024);
+ last if not defined $ret or $ret == 0;
# Is this necessary to keep? Probably.. #
# if you need to expect it later.
${*$self}{exp_Accum}.= ${*$self}{exp_Pty_Buffer};
@@ -1568,11 +1585,13 @@
# clean up child processes
sub DESTROY {
+ my $status = $?; # save this as it gets mangled by the terminating spawned children
my $self = shift;
if (${*$self}{exp_Do_Soft_Close}) {
$self->soft_close();
}
$self->hard_close();
+ $? = $status; # restore it. otherwise deleting an Expect object may mangle $?, which is unintuitive
}
1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/Expect.pod new/Expect-1.18/Expect.pod
--- old/Expect-1.15/Expect.pod 2002-03-19 12:59:29.000000000 +0100
+++ new/Expect-1.18/Expect.pod 2006-07-11 15:31:30.000000000 +0200
@@ -4,7 +4,7 @@
=head1 VERSION
-1.15
+1.18
=head1 SYNOPSIS
@@ -14,7 +14,7 @@
my $exp = Expect->spawn($command, @params)
or die "Cannot spawn $command: $!\n";
- # or by using an already opened filehandle
+ # or by using an already opened filehandle (e.g. from Net::Telnet)
my $exp = Expect->exp_init(\*FILEHANDLE);
# if you prefer the OO mindset:
@@ -114,6 +114,10 @@
like Tcl's Expect. An attempt was made to enable all the features of Tcl's
Expect without forcing Tcl on the victim programmer :-) .
+Please, before you consider using Expect, read the FAQs about
+L"I want to automate password entry for su/ssh/scp/rsh/..."> and
+L"I want to use Expect to automate [anything with a buzzword]...">
+
=head1 USAGE
@@ -185,9 +189,11 @@
=item $object->raw_pty(1 | 0)
-Set pty to raw mode before spawning. This disables echoing and CR->LF
-translation and gives a more pipe-like behaviour. Note that this must
-be set I<before> spawning the program.
+Set pty to raw mode before spawning. This disables echoing, CR->LF
+translation and an ugly hack for broken Solaris TTYs (which send
+<space><backspace> to slow things down) and thus gives a more
+pipe-like behaviour (which is important if you want to transfer binary
+content). Note that this must be set I<before> spawning the program.
=item $object->stty(qw(mode1 mode2...))
@@ -243,9 +249,12 @@
I<Simple interface:>
Given $timeout in seconds Expect will wait for $object's handle to produce
-one of the match_patterns. Due to o/s limitations $timeout should be a round
-number. If $timeout is 0 Expect will check one time to see if $object's
-handle contains any of the match_patterns. If $timeout is undef Expect
+one of the match_patterns, which are matched exactly by default. If you
+want a regexp match, prefix the pattern with '-re'.
+
+Due to o/s limitations $timeout should be a round number. If $timeout
+is 0 Expect will check one time to see if $object's handle contains
+any of the match_patterns. If $timeout is undef Expect
will wait forever for a pattern to match.
If called in a scalar context, expect() will return the position of
@@ -337,6 +346,8 @@
expect() call didn't match anything, exp_before() will return the entire
output of the object accumulated before the expect() call finished.
+Note that this is something different than Tcl Expects before()!!
+
=item $object->exp_after() I<or>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/MANIFEST new/Expect-1.18/MANIFEST
--- old/Expect-1.15/MANIFEST 2001-11-17 14:18:47.000000000 +0100
+++ new/Expect-1.18/MANIFEST 2006-05-05 14:30:48.000000000 +0200
@@ -19,3 +19,4 @@
examples/kibitz/README
examples/kibitz/kibitz
examples/kibitz/kibitz.man
+META.yml Module meta-data (added by MakeMaker)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/META.yml new/Expect-1.18/META.yml
--- old/Expect-1.15/META.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/Expect-1.18/META.yml 2006-07-11 16:00:41.000000000 +0200
@@ -0,0 +1,12 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: Expect
+version: 1.18
+version_from: Expect.pm
+installdirs: site
+requires:
+ IO::Pty: 1.03
+ IO::Tty: 1.03
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/Makefile.PL new/Expect-1.18/Makefile.PL
--- old/Expect-1.15/Makefile.PL 2002-03-13 13:40:44.000000000 +0100
+++ new/Expect-1.18/Makefile.PL 2006-05-05 14:31:55.000000000 +0200
@@ -8,8 +8,8 @@
'NAME' => 'Expect',
'VERSION_FROM' => 'Expect.pm',
'PREREQ_PM' => {
- 'IO::Tty' => 1.00,
- 'IO::Pty' => 1.00,
+ 'IO::Tty' => 1.03,
+ 'IO::Pty' => 1.03,
},
'clean' => { 'FILES' => '*.log' },
'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/README new/Expect-1.18/README
--- old/Expect-1.15/README 2002-03-13 13:40:44.000000000 +0100
+++ new/Expect-1.18/README 2006-07-11 15:35:10.000000000 +0200
@@ -1,5 +1,5 @@
-Expect.pm v1.14
+Expect.pm v1.18
===============
Expect requires the latest version of IO::Tty, also available from
@@ -14,16 +14,17 @@
make test
make install
-should work. I finally started a testsuite for Expect, but it doesn't
-really test anything deeper right now. The problem is to find some
-external program to use for generating reproducible output that is
-available across all platforms. Luckily, we can always use perl
-itself... Contributions to the testsuite are of course welcome.
+should work.
Note that IO::Tty is very system-dependend. It has been extensively
reworked and tested, but there still may be systems that have
problems.
+Please be sure to read the FAQ section in the Expect pod manpage,
+especially the section about using Expect to control telnet/ssh etc.
+There are other ways to work around password entry, you definitely
+don't need Expect for ssh automatisation!
+
The Perl Expect module was inspired more by the functionality of
Tcl/Expect than any previous Expect-like tool such as Comm.pl or
chat2.pl.
@@ -38,14 +39,6 @@
possible (so I can refer questions to the Tcl/Expect docu).
Suggestions for improvement are always welcome.
-[Latest rumours have it that Don plans a rewrite of Expect as a
-stand-alone library that can be easily embedded into various scripting
-languages.]
-
-There is now a FAQ section in the pod, complete with examples, so
-please let me know if there's something you'd like to see answered
-there that isn't.
-
There are two mailing lists available, expectperl-announce and
expectperl-discuss, at
@@ -59,43 +52,17 @@
From the Changes file:
======================
-! changed tests to check out pty behaviour (max. string length)
-
-+ added various FAQ entries
-
-+ added autoflush(1) to log_file
-
-+ split 'new' and 'spawn' to be able to set slave pty params via stty
- before actually spawning the program
-
-+ added raw_pty()
-
-+ added notransfer()
-
-+ added print_log_file(), send() now no longer prints to log file or stdout.
-
-! spawn() now synchronizes child and parent, so exec errors are reported.
-
-+ timeout handlers now also can exp_continue
-
-+ added 'raw_pty' option, also setting master to raw if isatty()
-
-+ added and corrected test for exit status; got rid of Test.pm
-
-! use 'set_raw' instead of stty("raw"); IO::Stty now optional
-
-+ updated docs & FAQs; explained how terminal sizes and SIGWINCH
- should be propagated
-
-! fixed bug in log_file, parameter now gets set to undef.
+! added another pipe to synchronize spawning. Closing the slave in the
+ parent can lead to a hang if the child already wrote something into
+ it...
-! fixed select in interconnect, may return -1 if interrupted by signal.
+! fixed REs in test to deal with shell prompts
-Thanks to everybody who wrote to me, either with bug reports or
-enhancement suggestions!
+Thanks to everybody who wrote to me, either with bug reports,
+enhancement suggestions or especially fixes!
Roland Giersig (maintainer of Expect.pm, IO::Tty, IO::Stty, Tie::Persistent)
RGiersig@cpan.org
-2002-03-12
+2005-07-11
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Expect-1.15/test.pl new/Expect-1.18/test.pl
--- old/Expect-1.15/test.pl 2002-03-19 12:54:04.000000000 +0100
+++ new/Expect-1.18/test.pl 2006-07-11 15:10:02.000000000 +0200
@@ -262,12 +262,12 @@
{
print "\nTesting controlling terminal...\n\n";
- my $exp = new Expect($Perl . q{ -MIO::Handle -e 'open(TTY, "+>/dev/tty") or die "no controlling terminal"; autoflush TTY 1; print TTY "prompt: "; $s = <TTY>; chomp $s; print "uc: \U$s\n"; close TTY; exit 0;'});
+ my $exp = new Expect($Perl . q{ -MIO::Handle -e 'open(TTY, "+>/dev/tty") or die "no controlling terminal"; autoflush TTY 1; print TTY "Expect_test_prompt: "; $s = <TTY>; chomp $s; print "uc: \U$s\n"; close TTY; exit 0;'});
my $pwd = "pAsswOrd";
$exp->log_file("test_dev_tty.log");
$exp->expect(10,
- [ qr/^prompt:/, sub {
+ [ qr/Expect_test_prompt:/, sub {
my $self = shift;
$self->send("$pwd\n");
$exp->log_file(undef);
@@ -292,9 +292,9 @@
print "\nChecking if exit status is returned correctly...\n\n";
{
- my $exp = new Expect($Perl . q{ -e 'print "pid: $$\n"; sleep 2; exit(42);'});
+ my $exp = new Expect($Perl . q{ -e 'print "Expect_test_pid: $$\n"; sleep 2; exit(42);'});
$exp->expect(10,
- [ qr/^pid:/, sub { my $self = shift; } ],
+ [ qr/Expect_test_pid:/, sub { my $self = shift; } ],
[ eof => sub { print "eof\n"; } ],
[ timeout => sub { print "timeout\n";} ],
);
@@ -307,9 +307,9 @@
print "\nChecking if signal exit status is returned correctly...\n\n";
{
- my $exp = new Expect($Perl . q{ -e 'print "pid: $$\n"; sleep 2; kill 15, $$;'});
+ my $exp = new Expect($Perl . q{ -e 'print "Expect_test_pid: $$\n"; sleep 2; kill 15, $$;'});
$exp->expect(10,
- [ qr/^pid:/, sub { my $self = shift; } ],
+ [ qr/Expect_test_pid:/, sub { my $self = shift; } ],
[ eof => sub { print "eof\n"; } ],
[ timeout => sub { print "timeout\n";} ],
);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit-help@opensuse.org