r30479 - in /branches/upstream/libnet-scp-expect-perl/current: ._CHANGES ._Expect.pm CHANGES Expect.pm META.yml Makefile.PL SIGNATURE

rmayorga at users.alioth.debian.org rmayorga at users.alioth.debian.org
Fri Feb 6 01:01:56 UTC 2009


Author: rmayorga
Date: Fri Feb  6 01:01:52 2009
New Revision: 30479

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30479
Log:
[svn-upgrade] Integrating new upstream version, libnet-scp-expect-perl (0.15)

Added:
    branches/upstream/libnet-scp-expect-perl/current/._CHANGES   (with props)
    branches/upstream/libnet-scp-expect-perl/current/._Expect.pm   (with props)
Modified:
    branches/upstream/libnet-scp-expect-perl/current/CHANGES
    branches/upstream/libnet-scp-expect-perl/current/Expect.pm
    branches/upstream/libnet-scp-expect-perl/current/META.yml
    branches/upstream/libnet-scp-expect-perl/current/Makefile.PL
    branches/upstream/libnet-scp-expect-perl/current/SIGNATURE

Added: branches/upstream/libnet-scp-expect-perl/current/._CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/._CHANGES?rev=30479&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libnet-scp-expect-perl/current/._CHANGES
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/upstream/libnet-scp-expect-perl/current/._CHANGES
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: branches/upstream/libnet-scp-expect-perl/current/._Expect.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/._Expect.pm?rev=30479&op=file
==============================================================================
Binary file - no diff available.

Propchange: branches/upstream/libnet-scp-expect-perl/current/._Expect.pm
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/upstream/libnet-scp-expect-perl/current/._Expect.pm
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: branches/upstream/libnet-scp-expect-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/CHANGES?rev=30479&op=diff
==============================================================================
--- branches/upstream/libnet-scp-expect-perl/current/CHANGES (original)
+++ branches/upstream/libnet-scp-expect-perl/current/CHANGES Fri Feb  6 01:01:52 2009
@@ -1,6 +1,11 @@
 Revision history for Perl extension Net-SCP-Expect
 
-0.14  
+0.15  Monday February 2 23:01:03 2009
+- Support IPv6 host addresses in long and short scp forms.
+- Add support for -C, -4 and -6 options (compress, force IPv4 and force
+IPv6, respectively).
+
+0.14  Saturday August 9 20:48:00 2008
 - Fixed RT#38081 (password not required if identity_file specified).
 - Fixed RT#36705 (itest.pl dynamically generates test files during runtime to reduce distribution size).
 

Modified: branches/upstream/libnet-scp-expect-perl/current/Expect.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/Expect.pm?rev=30479&op=diff
==============================================================================
--- branches/upstream/libnet-scp-expect-perl/current/Expect.pm (original)
+++ branches/upstream/libnet-scp-expect-perl/current/Expect.pm Fri Feb  6 01:01:52 2009
@@ -11,10 +11,11 @@
 use File::Basename;
 use Carp;
 use Cwd;
+use Net::IPv6Addr;
 
 BEGIN{
    use vars qw/$VERSION/;
-   $VERSION = '0.14';
+   $VERSION = '0.15';
 }
 
 # Options added as needed
@@ -43,6 +44,9 @@
       _subsystem     => $arg{subsystem} || undef,
       _scp_path      => $arg{scp_path} || undef,
       _auto_quote    => $arg{auto_quote} || 1,
+      _compress      => $arg{compress} || 0,
+      _force_ipv4    => $arg{force_ipv4} || 0,
+      _force_ipv6    => $arg{force_ipv6} || 0,
    };
 
    bless($self,$class);
@@ -92,6 +96,10 @@
 sub host{
    my($self,$host) = @_;
    croak("No host supplied to 'host()' method") unless $host;
+
+   # If host is an IPv6 address, strip any enclosing brackets if used
+   $host = substr($host, 1, length($host)-2) if $host && $host =~ /^\[/ && $host =~ /\]$/;
+
    $self->_set('host',$host);
 }
 
@@ -129,6 +137,9 @@
    my $subsystem     = $self->_get('subsystem');
    my $scp_path      = $self->_get('scp_path');
    my $auto_quote    = $self->_get('auto_quote');
+   my $compress      = $self->_get('compress');
+   my $force_ipv4    = $self->_get('force_ipv4');
+   my $force_ipv6    = $self->_get('force_ipv6');
  
    ##################################################################
    # If the second argument is not provided, the remote file will be
@@ -140,15 +151,15 @@
 
    my($host,$dest);
 
-   # Parse the to/from string. If the $from contains a ':', assume it is the remote host
+   # Parse the to/from string. If the $from contains a ':', assume it is a Remote to Local transfer
    if($from =~ /:/){
       ($login,$host,$dest) = $self->_parse_scp_string($from);
-      $from = "$login\@$host:";
+      $from = $login . '@' . $self->_format_host_string($host) . ':';
       $from .= "$dest" if $dest;
    }
-   else{
+   else{ # Local to Remote transfer
       ($login,$host,$dest) = $self->_parse_scp_string($to);
-      $to = "$login\@$host:";
+      $to = $login . '@' . $self->_format_host_string($host) . ':';
       $to .= "$dest" if $dest;
    }
 
@@ -172,6 +183,9 @@
    $flags .= "-s $qt$subsystem$qt " if $subsystem;
    $flags .= "-o $qt$option$qt " if $option;
    $flags .= "-i $qt$identity_file$qt " if $identity_file;
+   $flags .= "-C " if $compress;
+   $flags .= "-4 " if $force_ipv4;
+   $flags .= "-6 " if $force_ipv6;
 
    my $scp = Expect->new;
    #if($verbose){ $scp->raw_pty(1) }
@@ -307,7 +321,15 @@
    }
 
    my $temp = join('', at parts);
-   ($host,$dest) = split(/:/,$temp,2);
+   @parts = split(/:/,$temp);
+   if (@parts) {
+      if (@parts > 1) {
+         $host = join('', at parts[0,1..scalar(@parts)-2]);
+         $dest = $parts[-1];
+      } else {
+         $host = $parts[0];
+      }
+   }
 
    # scp('file','file') syntax, where local to remote is assumed
    unless($dest){
@@ -316,7 +338,24 @@
    }
 
    $host ||= $self->_get("host");
+
+   # If host is an IPv6 address, strip any enclosing brackets if used
+   $host = substr($host, 1, length($host)-2) if $host && $host =~ /^\[/ && $host =~ /\]$/;
+
    return ($user,$host,$dest);
+}
+
+sub _format_host_string{
+   my ($self,$host) = @_;
+
+   # If host is an IPv6 address, verify it is correctly formatted for scp
+   if ($host) {
+      $host = substr($host, 1, length($host)-2) if $host =~ /^\[/ && $host =~ /\]$/;
+      local $@;
+      $host = "[$host]" if eval { Net::IPv6Addr::ipv6_parse($host) };
+   }
+
+   return $host;
 }
 1;
 __END__
@@ -342,6 +381,12 @@
 
  my $scpe = Net::SCP::Expect->new(user=>'user',password=>'xxxx');
  $scpe->scp('host:/some/dir/filename','newfilename');
+
+B<Example 4 - uses login method, longhand scp, IPv6 compatible:>
+
+ my $scpe = Net::SCP::Expect->new;
+ $scpe->login('user name', 'password');
+ $scpe->scp('file','[ipv6-host]:/some/dir'); # <-- Important: scp() with explicit IPv6 host in to or from address must use square brackets
 
 See the B<scp()> method for more information on valid syntax.
 
@@ -412,19 +457,29 @@
 
 =head3 Local to Remote
 
-B<scp(>I<source, user at host:destination>B<);>
+B<scp(>I<source, user at host:destination>B<);> 
+
+B<scp(>I<source, user@[ipv6-host]:destination>B<);>  # Same as previous, with IPv6 host
 
 B<scp(>I<source, host:destination>B<);> # User already defined
 
+B<scp(>I<source, [ipv6-host]:destination>B<);> # Same as previous, with IPv6 host
+
 B<scp(>I<source, :destination>B<);> # User and host already defined
 
 B<scp(>I<source, destination>B<);> # Same as previous
 
+B<scp(>I<source>B<);> # Same as previous; destination will use base name of source
+
 =head3 Remote to Local
 
 B<scp(>I<user at host:source, destination>B<);>
 
+B<scp(>I<user@[ipv6-host]:source, destination>B<);> # Same as previous, with IPv6 host
+
 B<scp(>I<host:source, destination>B<);>
+
+B<scp(>I<[ipv6-host]:source, destination>B<);> # Same as previous, with IPv6 host
 
 B<scp(>I<:source, destination>B<);>
 
@@ -445,8 +500,16 @@
 
 B<cipher> - Selects the cipher to use for encrypting the data transfer.
 
+B<compress> - Compression enable.  Passes the -C flag to ssh(1) to enable compression.
+
+B<force_ipv4> - Forces scp to use IPv4 addresses only.
+
+B<force_ipv6> - Forces scp to use IPv6 addresses only.
+
 B<host> - Specify the host name.  This is now useful for both local-to-remote
-and remote-to-local transfers.
+and remote-to-local transfers.  For IPv6 addresses, either regular or square-bracket
+encapsulated host are allowed (since command-line scp normally expects IPv6
+addresses to be encapsulated in square brackets).
 
 B<identity_file> - Specify the identify file to use.
 

Modified: branches/upstream/libnet-scp-expect-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/META.yml?rev=30479&op=diff
==============================================================================
--- branches/upstream/libnet-scp-expect-perl/current/META.yml (original)
+++ branches/upstream/libnet-scp-expect-perl/current/META.yml Fri Feb  6 01:01:52 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Net-SCP-Expect
-version:             0.14
+version:             0.15
 abstract:            Wrapper for scp that allows passwords via Expect.
 license:             ~
 author:              
@@ -9,6 +9,7 @@
 distribution_type:   module
 requires:     
     Expect:                        1.14
+    Net::IPv6Addr:                 0.2
     Term::ReadPassword:            0.01
 meta-spec:
     url:     http://module-build.sourceforge.net/META-spec-v1.3.html

Modified: branches/upstream/libnet-scp-expect-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/Makefile.PL?rev=30479&op=diff
==============================================================================
--- branches/upstream/libnet-scp-expect-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-scp-expect-perl/current/Makefile.PL Fri Feb  6 01:01:52 2009
@@ -4,7 +4,7 @@
 WriteMakefile(
     'NAME'          => 'Net::SCP::Expect',
     'VERSION_FROM'  => 'Expect.pm', # finds $VERSION
-    'PREREQ_PM'     => {'Expect' => '1.14','Term::ReadPassword' => '0.01'},
+    'PREREQ_PM'     => {'Expect' => '1.14','Term::ReadPassword' => '0.01','Net::IPv6Addr' => '0.2'},
     ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
       (ABSTRACT_FROM => 'Expect.pm', # retrieve abstract from module
        AUTHOR        => 'Eric Rybski <rybskej at yahoo.com>') : ()),

Modified: branches/upstream/libnet-scp-expect-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-scp-expect-perl/current/SIGNATURE?rev=30479&op=diff
==============================================================================
--- branches/upstream/libnet-scp-expect-perl/current/SIGNATURE (original)
+++ branches/upstream/libnet-scp-expect-perl/current/SIGNATURE Fri Feb  6 01:01:52 2009
@@ -14,11 +14,11 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 60aa4d3b6a8cac84d11f3b18e870ae55e6acad5d CHANGES
-SHA1 6a756fc640e895f5e685002a7a83a565f53a0c0b Expect.pm
+SHA1 edb0e6e94e03545429479e814f4cdcf30b7fb84d CHANGES
+SHA1 1e953fd6700f7e724499b8d729ee4788bdb59346 Expect.pm
 SHA1 3215f56b06635a4d9204389c4e2f7f2e1fea221d MANIFEST
-SHA1 897c997b727983033805d63dfb7c9bdb02caee6f META.yml
-SHA1 c80c11b8e2dbc549e3deffedc51a5a3b682e7620 Makefile.PL
+SHA1 40940d17f7e6ae9df90681c5e96fb5489bea6e28 META.yml
+SHA1 47bc2fcee1ecef23f723b9b0e38423d55d1f3593 Makefile.PL
 SHA1 692dacfe15584c7b086fd49b8271505f48620f65 README
 SHA1 f45399354c8baa415a0326a96ffb55ba8f9d373d itest/README
 SHA1 4cffbf6d2a698e0c6a3ab5ecec8885b862f5e201 itest/itest.pl
@@ -29,7 +29,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (Darwin)
 
-iEYEARECAAYFAkieOsoACgkQQwn7DcpJEO4CKgCg06lR8qtJGGusn+ZnKFnnFXS+
-g+oAoJ80Y3GYYeLsfOb1ecYsby68mKT4
-=eTSb
+iEYEARECAAYFAkmHxE0ACgkQQwn7DcpJEO56zgCgw+axeIXIUgtkS1Xigu+C44BO
+vPYAn3j/LML++PtPtxLMR4omy7GWHxEr
+=nNtG
 -----END PGP SIGNATURE-----




More information about the Pkg-perl-cvs-commits mailing list