Index: /tags/ipp-20110622/ippScripts/scripts/chip_imfile.pl
===================================================================
--- /tags/ipp-20110622/ippScripts/scripts/chip_imfile.pl	(revision 32377)
+++ /tags/ipp-20110622/ippScripts/scripts/chip_imfile.pl	(revision 32378)
@@ -44,4 +44,5 @@
 my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
      $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned );
+
 GetOptions(
     'exp_id=s'          => \$exp_id,    # Exposure identifier
@@ -88,15 +89,18 @@
 }
 
-my ($logDest, $traceDest);
+my ($logRule, $traceDest);
 if ($run_state eq 'new') {
-    $logDest = prepare_output("LOG.IMFILE", $outroot, $class_id, 0);
+    $logRule = "LOG.IMFILE";
     $traceDest = prepare_output("TRACE.IMFILE",  $outroot, $class_id, 1);
 } else {
-    $logDest = prepare_output("LOG.IMFILE.UPDATE", $outroot, $class_id, 1);
+    $logRule = "LOG.IMFILE.UPDATE";
     $traceDest = prepare_output("TRACE.IMFILE.UPDATE",  $outroot, $class_id, 1);
 }
 
 if ($redirect) {
-    $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR );
+    my $logDest = $ipprc->filename($logRule, $outroot, $class_id);
+
+    $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR );
+
     print STDOUT "\n\n";
     print STDOUT "Starting script $0 on $host\n\n";
@@ -115,5 +119,5 @@
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
-&my_die("Couldn't find input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri);
+# &my_die("Couldn't find input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri);
 
 # outroot examples (HOST components must be set)
@@ -264,25 +268,26 @@
         ## Read camera config to get the current good burntool state :
         ## XXX This is extremely slow. Any better way to do this?
-        my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -";
-        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-            run(command => $camera_config_cmd, verbose => 0);
-        unless ($success) {
-            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-            &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-        }
-
-        my $camData = $mdcParser->parse(join "", @$stdout_buf) or
-            &my_die("Unable to parse ppConfigDump metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-
-        my $burntoolStateGood;
-        my $burntoolStateGoodUpdate;
-        foreach my $camEntry (@$camData) {
-            if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD") {
-                $burntoolStateGood = $camEntry->{value};
-            }
-            if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD.UPDATE") {
-                $burntoolStateGoodUpdate = $camEntry->{value};
-            }
-        }
+        ## my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -";
+        ## ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        ##     run(command => $camera_config_cmd, verbose => 0);
+        ## unless ($success) {
+        ##     $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        ##     &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+        ## }
+        ##
+        ## my $camData = $mdcParser->parse(join "", @$stdout_buf) or
+        ##     &my_die("Unable to parse ppConfigDump metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+
+        ## XXX short term hack until we have a C-based parser
+        my $burntoolStateGood = 14;
+        my $burntoolStateGoodUpdate = 13;
+        ## foreach my $camEntry (@$camData) {
+        ##     if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD") {
+        ##         $burntoolStateGood = $camEntry->{value};
+        ##     }
+        ##     if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD.UPDATE") {
+        ##         $burntoolStateGoodUpdate = $camEntry->{value};
+        ##     }
+        ## }
 
         if ($run_state eq 'new') {
@@ -446,5 +451,5 @@
     $command .= " -image_id $chip_imfile_id" if defined $chip_imfile_id;
     $command .= " -source_id $source_id" if defined $source_id;
-    $command .= " -tracedest $traceDest -log $logDest";
+    $command .= " -tracedest $traceDest";
     $command .= " -dbname $dbname" if defined $dbname;
 
