Subject: | Module does not work with current version of Net-SSH-Perl and needs an update (solution attached) |
Date: | Tue, 16 Nov 2010 14:26:38 +0000 |
To: | <bug-Net-SSH-W32Perl [...] rt.cpan.org> |
From: | <duncan.loveday [...] bt.com> |
Hi,
The Net-SSH-W32Perl module works by re-defining a method "protocol_class" in the Net-SSH-Perl module. Trouble is, that method no longer exists with that name. To work in the same way the module now needs to re-define a different method, "set_protocol". I have changed this locally and it works well. Here is the change
$ diff -r /cygdrive/C/perl/site/lib/Net/SSH/W32Perl.pm PatchedCPAN/Net/SSH/W32Perl.pm
2a3,6
Show quoted text
> ## DL Added the line below otherwise windows executables from perl_app
> ## don't incorporate the necessary module...
> require Net::SSH::W32Perl::SSH2;
>
62a67,85
Show quoted text> ## DL Added method below since method protocol_class that
> ## is meant to be re-defined above no longer exists...
> sub set_protocol {
> return shift->SUPER::set_protocol(@_) unless IS_WIN32;
>
> die "SSH2 is the only supported protocol under MSWin32!"
> unless (PROTOCOL_SSH2 == $_[1]);
>
> my $ssh = shift;
> my $proto = shift;
> $ssh->{use_protocol} = $proto;
> my $proto_class = "Net::SSH::W32Perl::SSH2";
> (my $lib = $proto_class . ".pm") =~ s!::!/!g;
> require $lib;
> bless $ssh, $proto_class;
> $ssh->debug($proto_class->version_string);
> $ssh->_proto_init;
> }
>
Suggest this or some equivalent be implemented.
Duncan.