IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27092


Ignore:
Timestamp:
Feb 25, 2010, 2:26:12 PM (16 years ago)
Author:
bills
Message:

Add force argument to $ipprc->file_delete() use it in magic_destreak_revert.pl

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Config.pm

    r26516 r27092  
    655655    my $self = shift;                # Configuration object
    656656    my $name = shift;                # File name to check
     657    my $force = shift;               # pass force flag to the delete method
    657658    my $status;
    658659
    659660    my $scheme = file_scheme($name); # The scheme, e.g., file://, path://
    660661    if (defined $scheme and lc($scheme) eq 'neb') {
    661         $status = eval { $self->nebulous->delete( $name ); };
     662        $status = eval { $self->nebulous->delete( $name, $force ); };
    662663        ( carp "Unable to delete Nebulous handle $name" and return undef ) if $@;
    663664    } else {
  • trunk/ippScripts/scripts/magic_destreak_revert.pl

    r27015 r27092  
    253253    if ($mask) {
    254254        if (!revert_file($mask, $bmask)) {
    255             if ($stage eq 'chip') {
    256                 # don't fail if the mask file (from the camera stage) fails to revert.
    257                 # It probably doesn't exist
    258                 # XXX: Handle this properly
    259                 print STDERR "failure to revert mask file, ignored\n";
    260             } else {
    261                 &my_die("failed to restore mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    262             }
     255            &my_die("failed to restore mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    263256        }
    264257    }
     
    306299    my $original = shift;
    307300    my $backup   = shift;
     301    my $force = 1; # force deletion of backup files in nebulous
    308302
    309303    my $o_path = $ipprc->file_resolve($original);
     
    352346        }
    353347
    354         if ($b_path and -e $b_path) {
     348        if ($b_path) {
    355349            print "ready to delete backup\n" if $verbose;
    356             if (! $ipprc->file_delete($backup)) {
     350            if (! $ipprc->file_delete($backup, $force)) {
    357351                print "failed to delete $backup\n";
    358352                return 0;
     
    363357        print "original uri: $original is not a destreaked file no need to swap backup_result: $backup_result\n";
    364358        # delete the 'backup' (destreaked target) file if it exists
    365         if ($b_path and -e $b_path) {
    366             if (! $ipprc->file_delete($backup)) {
     359        if ($b_path) {
     360            if (! $ipprc->file_delete($backup, $force)) {
    367361                print "failed to delete $backup\n";
    368362                return 0;
Note: See TracChangeset for help on using the changeset viewer.