Show
Ignore:
Timestamp:
03/12/08 13:10:37 (7 years ago)
Author:
lopnor
Message:

lang/perl/Net-FTP-Stepstone: fix some environmental error

Location:
lang/perl/Net-FTP-Stepstone/trunk
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Net-FTP-Stepstone/trunk/MANIFEST

    r7826 r7829  
    1515t/data/d/f 
    1616t/data/d/g 
     17t/dest/test 
  • lang/perl/Net-FTP-Stepstone/trunk/MANIFEST.SKIP

    r7826 r7829  
    1010\.gz$ 
    1111\.cvsignore 
     12\.svn 
  • lang/perl/Net-FTP-Stepstone/trunk/lib/Net/FTP/Stepstone.pm

    r7825 r7829  
    88use Time::Piece; 
    99 
    10 our $VERSION = '0.01'; 
     10our $VERSION = '0.02'; 
    1111__PACKAGE__->mk_accessors(qw( 
    1212    cwd 
     
    7676        my $self = shift; 
    7777        my $arg = join ' ', @_; 
    78         return $self->_ftp_command("$command $arg"); 
     78        my $res = $self->_ftp_command("$command $arg"); 
     79        return $res unless $res =~ /^2/; 
     80        return; 
    7981    }; 
    8082} 
     
    9698EOF 
    9799    my @all = ` echo "$ftp_command" | ssh -l $self->{stepstone_user} $self->{stepstone_addr} ftp -n 2>/dev/null`; 
    98     my @lines = grep {$_ !~ m/AUTH not understood|Interactive mode off.|Local directory now|File may not have transferred correctly./} @all; 
     100    my @lines = grep {$_ !~ m/not understood|Interactive mode off.|Local directory now/} @all; 
    99101    if (my $last_line = $lines[-1]) { 
    100102        my ($code, $cwd) = split '"', $last_line; 
  • lang/perl/Net-FTP-Stepstone/trunk/t/04_stat.t

    r7825 r7829  
    5252{ 
    5353    my $file = "$FindBin::Bin/data/d/e"; 
     54    my $time = Time::Piece->strptime('2008-03-08', "%Y-%m-%d")->epoch; 
     55    utime $time, $time, $file;  
    5456    my $stat = $ftp->stat('e'); 
    5557    is $stat->size, stat($file)->size; 
     
    5961{ 
    6062    my $file = "$FindBin::Bin/data/d/f"; 
     63    my $time = Time::Piece->strptime('2008-03-07', "%Y-%m-%d")->epoch; 
     64    utime $time, $time, $file;  
    6165    my $stat = $ftp->stat('f'); 
    6266    is $stat->size, stat($file)->size; 
     
    7680    my $stat = $ftp->stat('/d/f'); 
    7781    is $stat->size, stat($file)->size; 
    78     is $stat->mtime, 1204846200; 
     82    is localtime($stat->mtime)->ymd, '2008-03-07'; 
    7983    is $stat->mode, stat($file)->mode; 
    8084}