Changeset 123 for trunk

Show
Ignore:
Timestamp:
04/19/10 15:07:00 (4 years ago)
Author:
depesz
Message:

Make it compatible with older Perl and File::Path

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/omnipitr/lib/OmniPITR/Program/Archive.pm

    r121 r123  
    1010use File::Basename; 
    1111use File::Spec; 
    12 use File::Path qw( make_path remove_tree ); 
     12use File::Path qw( mkpath rmtree ); 
    1313use File::Copy; 
    1414use Storable; 
     
    111111sub cleanup { 
    112112    my $self = shift; 
    113     remove_tree( $self->{ 'temp-dir' } ); 
     113    rmtree( $self->{ 'temp-dir' } ); 
    114114    unlink $self->{ 'state-file' } if $self->{ 'state-file' }; 
    115115    return; 
     
    230230    my $self = shift; 
    231231    my $full_temp_dir = File::Spec->catfile( $self->{ 'temp-dir' }, basename( $PROGRAM_NAME ), basename( $self->{ 'segment' } ) ); 
    232     make_path( $full_temp_dir ); 
     232    mkpath( $full_temp_dir ); 
    233233    $self->{ 'temp-dir' } = $full_temp_dir; 
    234234    return; 
  • trunk/omnipitr/lib/OmniPITR/Program/Restore.pm

    r116 r123  
    1010use File::Basename; 
    1111use File::Spec; 
    12 use File::Path qw( make_path remove_tree ); 
     12use File::Path qw( mkpath rmtree ); 
    1313use File::Copy; 
    1414use Storable; 
     
    132132    my $xlog_dir  = File::Spec->catfile( $self->{ 'temp-dir' }, 'pg_xlog' ); 
    133133    my $xlog_file = File::Spec->catfile( $xlog_dir,             $segment_name ); 
    134     make_path( $xlog_dir ); 
     134    mkpath( $xlog_dir ); 
    135135 
    136136    my $comment = 'Copying segment ' . $segment_name . ' to ' . $xlog_file; 
     
    157157    chdir $previous_dir; 
    158158 
    159     remove_tree( $xlog_dir ); 
     159    rmtree( $xlog_dir ); 
    160160    return 1 unless $result->{ 'error_code' }; 
    161161 
     
    420420    my $code = shift; 
    421421 
    422     remove_tree( $self->{ 'temp-dir' } ) if $self->{ 'temp-dir-prepared' }; 
     422    rmtree( $self->{ 'temp-dir' } ) if $self->{ 'temp-dir-prepared' }; 
    423423 
    424424    exit( $code ); 
     
    439439    return if $self->{ 'temp-dir-prepared' }; 
    440440    my $full_temp_dir = File::Spec->catfile( $self->{ 'temp-dir' }, basename( $PROGRAM_NAME ) ); 
    441     make_path( $full_temp_dir ); 
     441    mkpath( $full_temp_dir ); 
    442442    $self->{ 'temp-dir' }          = $full_temp_dir; 
    443443    $self->{ 'temp-dir-prepared' } = 1;