IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2011, 11:17:17 AM (14 years ago)
Author:
bills
Message:

add --rerun option which rebuilds a distribution bundle for a given component.
This may be used to replace files lost due to disk problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_component.pl

    r30922 r32947  
    3737# Parse the command-line arguments
    3838my ($dist_id, $camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean, $alt_path_base);
    39 my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $exp_type);
     39my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $exp_type, $rerun);
    4040my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4141
     
    5757           'outdir=s'       => \$outdir,     # "directory" for outputs
    5858           'clean'          => \$clean,      # create clean distribution
     59           'rerun'          => \$rerun,      # recreate an existing component and update the database
    5960           'save-temps'     => \$save_temps, # Save temporary files?
    6061           'dbname=s'       => \$dbname,     # Database name
     
    7677
    7778my $ipprc = PS::IPP::Config->new($camera); # IPP configuration
    78 $ipprc->redirect_output($logfile) if $logfile;
     79$ipprc->redirect_to_logfile($logfile) if $logfile;
    7980
    8081my $temproot = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR");
     
    146147
    147148{
    148     my $command = "$disttool -addprocessedcomponent -dist_id $dist_id -component $component -outdir $outdir";
     149    my $command;
     150    if (!$rerun) {
     151        $command = "$disttool -addprocessedcomponent";
     152    } else {
     153        $command = "$disttool -updateprocessedcomponent";
     154    }
     155   
     156    $command .= " -dist_id $dist_id -component $component -outdir $outdir";
    149157    $command .= " -name $file_name -bytes $bytes -md5sum $md5sum";
    150158    $command .= " -dbname $dbname" if defined $dbname;
     
    175183    $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
    176184
    177     my $command = "$disttool -addprocessedcomponent";
     185    my $command;
     186    if (!$rerun) {
     187        $command = "$disttool -addprocessedcomponent";
     188    } else {
     189        $command = "$disttool -updateprocessedcomponent";
     190    }
    178191    $command   .= " -dist_id $dist_id";
    179192    $command   .= " -component $component";
Note: See TracChangeset for help on using the changeset viewer.