IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2010, 3:53:13 PM (16 years ago)
Author:
bills
Message:

don't add force flag unless --force is included on the command line

File:
1 edited

Legend:

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

    r27221 r27256  
    3636
    3737# Parse the command-line arguments
    38 my ($magic_ds_id, $camera);
     38my ($magic_ds_id, $camera, $force);
    3939my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile);
    4040
     
    4242           'magic_ds_id=s'  => \$magic_ds_id,# Magic destreak run identifier
    4343           'camera=s'       => \$camera,     # camera for evaluating file rules
     44           'force'          => \$force,      # force deletion
    4445           'save-temps'     => \$save_temps, # Save temporary files?
    4546           'dbname=s'       => \$dbname,     # Database name
     
    104105my $cam_path_base = $run->{cam_path_base};
    105106my $inverse = $run->{inverse};
     107my $replace = $run->{re_place};
    106108
    107109
    108110&my_die("unexpected run state found: $state", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $state ne "goto_cleaned";
    109 &my_die("clean not allowed for raw stage, use goto_restore", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $stage eq "raw";
     111&my_die("clean not allowed for raw stage, use goto_restore", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if ($stage eq "raw"); # XXX: add this once we implement and $replace;
    110112
    111113
     
    126128            # we use the mask output from the camera stage for input and replace
    127129            # the output of the chip stage with that mask as well.
    128             my $cammask   = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $component);
     130            my $cammask   = $cam_path_base ? $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $component) : undef;
    129131
    130132            if ($backup_path_base) {
     
    141143                }
    142144
    143                 $bmask   = dirname($backup_path_base) . "/" . $prefix . basename($cammask);
     145                $bmask   = dirname($backup_path_base) . "/" . $prefix . basename($cammask) if $cammask;
    144146            }
    145147            if ($recovery_path_base) {
     
    148150                $rweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $recovery_path_base, $component);
    149151                # This is kludgey but correct
    150                 $rmask   = dirname($recovery_path_base) . "/" . basename($cammask);
     152                $rmask   = dirname($recovery_path_base) . "/" . basename($cammask) if $cammask;;
    151153            }
    152154        } elsif ($stage eq "camera") {
     
    226228                if (!$no_update) {
    227229                    print STDERR "deleting $file\n" if $verbose;
    228                     $ipprc->file_delete($file, 1) or my_die("Failed to delete $file", $magic_ds_id, $PS_EXIT_UNKNOWN_ERROR);
    229                     } else {
     230                    $ipprc->file_delete($file, $force) or my_die("Failed to delete $file", $magic_ds_id, $PS_EXIT_UNKNOWN_ERROR);
     231                } else {
    230232                    print STDERR "skipping delete $file\n";
    231233                }
Note: See TracChangeset for help on using the changeset viewer.