IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2011, 1:58:31 PM (15 years ago)
Author:
bills
Message:

fix problems with reverting runs with replace == false

File:
1 edited

Legend:

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

    r30693 r30754  
    7878    defined $outroot;
    7979
    80 &my_die("bytes and md5sum are is required for raw stage stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($stage eq 'raw' and (!$bytes or !$md5sum));
     80if (defined($replace) and ($replace eq "T")) {
     81    $replace = 1;
     82} else {
     83    $replace = 0;
     84}
     85
     86my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     87
     88$ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR ) if $logfile;
     89
     90&my_die("bytes and md5sum are is required for raw stage stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($replace and $stage eq 'raw' and (!$bytes or !$md5sum));
    8191
    8292&my_die("cam_path_base is required for chip stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($stage eq 'chip' and !$cam_path_base);
     
    8494
    8595
    86 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    87 
    88 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR ) if $logfile;
    8996
    9097$cam_reduction = 'DEFAULT' if !defined $cam_reduction or ($cam_reduction eq "NULL");
     
    118125my $basename = basename($path_base);
    119126my $nebulousInput = inNebulous($dirname);
    120 
    121 if (defined($replace) and ($replace eq "T")) {
    122     $replace = 1;
    123 } else {
    124     $replace = 0;
    125 }
    126127
    127128&my_die("replace not allowed for non-nebulous files", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR)
     
    370371    my $force = 1; # force deletion of backup files in nebulous
    371372
     373    if (!$replace) {
     374        # we don't need to do all of this checking unless the destreak run is
     375        # replace mode just delete the backup
     376        my $error_code = $ipprc->kill_file($backup);
     377        if ($error_code) {
     378            print STDERR "failed to kill $backup: error_code $error_code\n";
     379            return 0;
     380        } else {
     381            return 1;
     382        }
     383    }
     384
    372385    my $o_path = $ipprc->file_resolve($original);
    373386    my $original_result;
Note: See TracChangeset for help on using the changeset viewer.