Changeset 125

Show
Ignore:
Timestamp:
04/19/10 16:05:57 (4 years ago)
Author:
depesz
Message:

let it work with .history files

Files:

Legend:

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

    r123 r125  
    193193    my @too_old = (); 
    194194    for my $file ( @content ) { 
    195         $file =~ s/\Q$extension\E\z//
     195        $file =~ s/\Q$extension\E\z// if $extension
    196196        next unless $file =~ m{\A[a-fA-F0-9]{24}(?:\.[a-fA-F0-9]{8}\.backup)?\z}; 
    197197        next unless $file lt $last_important; 
     
    314314        if ( $self->{ 'finish' } ) { 
    315315            $self->log->error( 'Got finish request. Dying.' ); 
     316            $self->exit_with_status( 1 ); 
     317        } 
     318        if ( $self->{ 'segment' } =~ m{\A[a-fA-f0-9]{8}\.history\z} ) { 
     319            $self->log->log( 'Requested history file (%s) that does not exist. Returning error.', $self->{ 'segment' } ); 
    316320            $self->exit_with_status( 1 ); 
    317321        } 
     
    544548    $self->log->fatal( 'Given data-dir (%s) is not valid', $self->{ 'data-dir' } ) unless -d $self->{ 'data-dir' } && -f File::Spec->catfile( $self->{ 'data-dir' }, 'PG_VERSION' ); 
    545549 
    546     $self->log->fatal( 'Given segment name is not valid (%s)', $self->{ 'segment' } ) unless $self->{ 'segment' } =~ m{\A[a-fA-F0-9]{24}(?:\.[a-fA-F0-9]{8}\.backup)?\z}; 
     550    $self->log->fatal( 'Given segment name is not valid (%s)', $self->{ 'segment' } ) unless $self->{ 'segment' } =~ m{\A([a-fA-F0-9]{24}(?:\.[a-fA-F0-9]{8}\.backup)?|[a-fA-F0-9]{8}\.history)\z}; 
    547551 
    548552    $self->log->fatal( 'Given source (%s) is not a directory', $self->{ 'source' }->{ 'path' } ) unless -d $self->{ 'source' }->{ 'path' };