Changeset 60


Ignore:
Timestamp:
11/27/05 00:34:02 (19 years ago)
Author:
thauvin
Message:
  • match rules should be applies over data file, not the archive
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/soft/ObsData/ObsData/Repository.pm

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r59 r60  
    66use warnings; 
    77use ObsData; 
     8use ObsData::Archive; 
    89use Config::IniFiles; 
    910 
     
    7172            } 
    7273 
    73             if (! $self->file_need_parse($file)) { 
     74            my $newer = $self->file_need_parse($file); 
     75 
     76 
     77            $self->loging(0, "trying to read archive content of %s", $file); 
     78            my $archive = ObsData::Archive->new("$self->{dir}/$file") or do { 
     79                $self->loging(4,  
     80                    "Can't handle archive %s: %s, skipping", 
     81                    $file, 
     82                    ObsData::Archive->error 
     83                ); 
    7484                next; 
     85            }; 
     86 
     87            foreach my $content ($archive->ls) { 
     88                $self->loging(0, "archive %s: content %s", $file, $content); 
     89                my ($datatype, $destfile) = $self->{obsdata}->build_dest_filename($content, $self->{datatype}); 
     90                $self->loging(0, "%s/%s file, datatype %s, destination %s", 
     91                    $file, $content, 
     92                    $datatype || '(none)', 
     93                    $destfile || '(none)', 
     94                ); 
     95 
     96                if (!$datatype) { 
     97                    $self->loging(3, "I don't know what to do of %s/%s", $file, $content); 
     98 
     99                    next; 
     100                } 
    75101            } 
    76  
    77             my ($datatype, $destfile) = $self->{obsdata}->build_dest_filename($file, $self->{datatype}); 
    78             $self->loging(0, "%s file, datatype %s, destination %s", 
    79                 $file, 
    80                 $datatype || '(none)', 
    81                 $destfile || '(none)', 
    82             ); 
    83  
    84             if (!$datatype) { 
    85                 $self->loging(3, "I don't know what to do of %s", $file); 
    86  
    87                 next; 
    88             } 
    89  
    90             $self->install_file($file, $destfile); 
     102            # $self->install_file($file, $destfile); 
    91103 
    92104        } 
     
    129141        } 
    130142         
    131         if ($olddatatype) { 
     143        #if ($olddatatype) { 
     144        if (defined($oldmtime) && defined($oldsize)) { 
    132145            if (! ($sizeok && $mtimeok)) { 
    133146                $self->loging(3, "File %s allready processed but has changed:%s%s, skipping", 
     
    137150                ); 
    138151            } 
    139             $self->loging(0, "%s has been allready processed: was %s", $file, $olddatatype); 
     152        #    $self->loging(0, "%s has been allready processed: was %s", $file, $olddatatype); 
    140153            return 0; 
    141154        } else { 
     
    158171} 
    159172 
    160 sub installfile { 
     173sub install_file { 
     174    my ($self, $file) = @_; 
    161175     
    162176} 
Note: See TracChangeset for help on using the changeset viewer.