Index: trunk/ippScripts/scripts/dist_component.pl
===================================================================
--- trunk/ippScripts/scripts/dist_component.pl	(revision 30922)
+++ trunk/ippScripts/scripts/dist_component.pl	(revision 32947)
@@ -37,5 +37,5 @@
 # Parse the command-line arguments
 my ($dist_id, $camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean, $alt_path_base);
-my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $exp_type);
+my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $exp_type, $rerun);
 my ($dbname, $save_temps, $verbose, $no_update, $logfile);
 
@@ -57,4 +57,5 @@
            'outdir=s'       => \$outdir,     # "directory" for outputs
            'clean'          => \$clean,      # create clean distribution
+           'rerun'          => \$rerun,      # recreate an existing component and update the database
            'save-temps'     => \$save_temps, # Save temporary files?
            'dbname=s'       => \$dbname,     # Database name
@@ -76,5 +77,5 @@
 
 my $ipprc = PS::IPP::Config->new($camera); # IPP configuration
-$ipprc->redirect_output($logfile) if $logfile;
+$ipprc->redirect_to_logfile($logfile) if $logfile;
 
 my $temproot = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR");
@@ -146,5 +147,12 @@
 
 {
-    my $command = "$disttool -addprocessedcomponent -dist_id $dist_id -component $component -outdir $outdir";
+    my $command;
+    if (!$rerun) {
+        $command = "$disttool -addprocessedcomponent";
+    } else {
+        $command = "$disttool -updateprocessedcomponent";
+    }
+    
+    $command .= " -dist_id $dist_id -component $component -outdir $outdir";
     $command .= " -name $file_name -bytes $bytes -md5sum $md5sum";
     $command .= " -dbname $dbname" if defined $dbname;
@@ -175,5 +183,10 @@
     $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
 
-    my $command = "$disttool -addprocessedcomponent";
+    my $command;
+    if (!$rerun) {
+        $command = "$disttool -addprocessedcomponent";
+    } else {
+        $command = "$disttool -updateprocessedcomponent";
+    }
     $command   .= " -dist_id $dist_id";
     $command   .= " -component $component";
