Changeset 65


Ignore:
Timestamp:
11/28/05 19:15:07 (19 years ago)
Author:
thauvin
Message:
  • add status for each data files
File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.11 to 1.12
    r63 r65  
    9191            foreach my $content ($archive->ls) { 
    9292                $self->loging(0, "archive %s: content %s", $file, $content); 
    93                 my ($datatype, $destfile) = $self->{obsdata}->build_dest_filename($content, $self->{datatype}); 
     93 
     94                my $last_process = $self->{status}->val($file, "data_processtime_$content"); 
     95                if ($last_process) { 
     96                    $self->loging(0, "%s/%s has been already processed at %s, skipping", 
     97                        $file, 
     98                        $content, 
     99                        scalar(localtime($last_process)), 
     100                    ); 
     101                    next; 
     102                } 
     103                 
     104                my ($datatype, $destfile) = $self->{obsdata}->build_dest_filename( 
     105                    $content,  
     106                    $self->{datatype} 
     107                ); 
     108                 
    94109                $self->loging(0, "%s/%s file, datatype %s, destination %s", 
    95110                    $file, $content, 
     
    98113                ); 
    99114 
     115                my $ltime = time; 
     116                $self->{status}->newval( 
     117                    $file, 
     118                    "data_processtime_$content", 
     119                    $ltime 
     120                ); 
     121                $self->{status}->SetParameterComment( 
     122                    $file,  
     123                    "data_processtime_$content", 
     124                    $ObsData::CVSID, 
     125                    $ObsData::Repository::CVSID, 
     126                    scalar(localtime($ltime)), 
     127                ); 
     128 
     129                 
    100130                if (!$datatype) { 
    101131                    $self->loging(3, "I don't know what to do of %s/%s", $file, $content); 
     
    104134                } elsif ($destfile) { 
    105135                    $self->loging(0, "Extracting %s/%s to %s", $file, $content, $destfile); 
    106  
     136     
    107137                    my ($dirname) = $destfile =~ m!(?:(.*)/)?(.*)$!; #! vim syntax 
    108138                    if ($dirname && ! -d $dirname) { 
     
    114144                    } 
    115145 
    116                     $archive->extract($content, $destfile) or $self->loging( 
    117                         4, "Can't extract %s/%s to %s: %s", 
    118                         $file, $content, $destfile, 
    119                         $archive->error, 
    120                     ); 
     146                    if ($archive->extract($content, $destfile)) { 
     147                        $self->{status}->newval($file, "data_type_$content", $datatype); 
     148                        $self->{status}->newval($file, "data_dest_$content", $destfile); 
     149                    } else { 
     150                        $self->loging( 
     151                            4, "Can't extract %s/%s to %s: %s", 
     152                            $file, $content, $destfile, 
     153                            $archive->error, 
     154                        ); 
     155                    } 
    121156                     
    122157                } else { 
Note: See TracChangeset for help on using the changeset viewer.