Index: trunk/ippScripts/scripts/dist_bundle.pl
===================================================================
--- trunk/ippScripts/scripts/dist_bundle.pl	(revision 26043)
+++ trunk/ippScripts/scripts/dist_bundle.pl	(revision 26044)
@@ -8,6 +8,6 @@
 use Sys::Hostname;
 my $host = hostname();
-print "\n\n";
-print "Starting script $0 on $host\n\n";
+# print "\n\n";
+# print "Starting script $0 on $host\n\n";
 
 use vars qw( $VERSION );
@@ -60,8 +60,9 @@
 # Parse the command-line arguments
 my ($camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean);
-my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality);
+my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file);
 my ($dbname, $save_temps, $verbose, $no_update, $logfile);
 
 GetOptions(
+           'results_file=s' => \$results_file,     # camera for evaluating file rules
            'camera=s'       => \$camera,     # camera for evaluating file rules
            'stage=s'        => \$stage,      # raw, chip, warp, or diff
@@ -303,10 +304,15 @@
 }
 
-print "bundleResults MULTI\n\n";
-print "bundleResults METADATA\n";
-print "   name      STR    $file_name\n";
-print "   bytes     S64    $bytes\n";
-print "   md5sum    STR    $md5sum\n";
-print "END\n\n";
+if ($results_file) {
+    open RF, ">$results_file" or &my_die("unable to open results file $results_file", $component, $PS_EXIT_UNKNOWN_ERROR);
+    print RF "bundleResults MULTI\n\n";
+    print RF "bundleResults METADATA\n";
+    print RF "   name      STR    $file_name\n";
+    print RF "   bytes     S64    $bytes\n";
+    print RF "   md5sum    STR    $md5sum\n";
+    print RF "END\n\n";
+
+    close RF;
+}
 
 exit 0;
Index: trunk/ippScripts/scripts/dist_component.pl
===================================================================
--- trunk/ippScripts/scripts/dist_component.pl	(revision 26043)
+++ trunk/ippScripts/scripts/dist_component.pl	(revision 26044)
@@ -83,7 +83,11 @@
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
+my ($rf, $rf_name) = tempfile("/tmp/bundleresults.$dist_id.$component.XXXX", UNLINK => !$save_temps);
+close $rf;
+
 my ($file_name, $bytes, $md5sum);
 {
     my $command = "$dist_make_bundle --camera $camera --stage $stage --stage_id $stage_id";
+    $command .= " --results_file $rf_name";
     $command .= " --component $component --path_base $path_base --outdir $outdir";
     $command .= " --chip_path_base $chip_path_base" if $chip_path_base;
@@ -105,7 +109,11 @@
     }
 
-    # parse stdout_buf to get ($file_name, $bytes, $md5sum);
-    my $metadata = $mdcParser->parse (join "", @$stdout_buf) or
+    open $rf, "<$rf_name" or &my_die("failed to open results file $rf_name", $dist_id, $component, $PS_EXIT_UNKNOWN_ERROR);
+
+    my @lines = (<$rf>);
+
+    my $metadata = $mdcParser->parse (join "", @lines) or
         &my_die("Unable to parse metadata config doc", $dist_id, $component, $PS_EXIT_PROG_ERROR);
+
     my $results = parse_md_list($metadata);
 
@@ -114,12 +122,13 @@
         &my_die("Unexected number of results from dist_make_bundle.pl: $n", $dist_id, $component, $PS_EXIT_PROG_ERROR);
     }
+    my $result = $results->[0];
 
-    $file_name = $results->{name};
+    $file_name = $result->{name};
     &my_die("undefined file name from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $file_name;
 
-    $bytes = $results->{bytes};
+    $bytes = $result->{bytes};
     &my_die("undefined file size from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $bytes;
 
-    $md5sum = $results->{md5sum};
+    $md5sum = $result->{md5sum};
     &my_die("undefined file md5sum from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $md5sum;
 }
