Changeset 21314

Show
Ignore:
Timestamp:
09.12.2009 15:32:17 (10 years ago)
Author:
kjdon
Message:

check return values for remove_one, and stop the pipeline once found something positive

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugin.pm

    r21307 r21314  
    233233    my $src_rec = GDBMUtils::gdbmRecordToHash($arcinfo_src_filename,$file); 
    234234    my $oids = $src_rec->{'oid'}; 
    235     map {$_->remove_one($file, $oids); } @$pluginfo; 
     235    my $rv; 
     236    foreach my $plugobj (@$pluginfo) { 
     237 
     238        $rv = $plugobj->remove_one($file, $oids, $archivedir); 
     239        if (defined $rv && $rv != -1) { 
     240        return $rv; 
     241        } # else undefined (was not recognised by the plugin) or there was an error, try the next one 
     242    } 
     243    return 0; 
    236244    } 
    237245