Changeset 124

Show
Ignore:
Timestamp:
04/19/10 15:37:00 (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/Archive.pm

    r123 r124  
    393393    } 
    394394 
    395     $self->log->fatal( 'Given segment name is not valid (%s)', $self->{ 'segment' } ) unless basename( $self->{ 'segment' } ) =~ m{\A[a-fA-F0-9]{24}(?:\.[a-fA-F0-9]{8}\.backup)?\z}; 
     395    $self->log->fatal( 'Given segment name is not valid (%s)', $self->{ 'segment' } ) unless basename( $self->{ 'segment' } ) =~ m{\A(?:[a-fA-F0-9]{24}(?:\.[a-fA-F0-9]{8}\.backup)?|[a-fA-F0-9]{8}\.history)\z}; 
    396396    my $segment_file_name = $self->{ 'segment' }; 
    397397    $segment_file_name = File::Spec->catfile( $self->{ 'data-dir' }, $self->{ 'segment' } ) unless $self->{ 'segment' } =~ m{^/}; 
     
    401401    $self->log->fatal( 'Given segment (%s) is not readable.', $segment_file_name ) unless -r $segment_file_name; 
    402402 
    403     unless ( $self->{ 'segment' } =~ m{\.backup\z} ) { 
     403    if ( $self->{ 'segment' } =~ m{\A[a-fA-F0-9]{24}\z} ) { 
    404404        my $expected_size = 256**3; 
    405405        my $file_size     = ( -s $segment_file_name );