IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 5, 2009, 10:22:11 AM (17 years ago)
Author:
bills
Message:

use a temporary file for output from dist_bundle.pl. stdout is too noisy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_component.pl

    r26043 r26044  
    8383my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    8484
     85my ($rf, $rf_name) = tempfile("/tmp/bundleresults.$dist_id.$component.XXXX", UNLINK => !$save_temps);
     86close $rf;
     87
    8588my ($file_name, $bytes, $md5sum);
    8689{
    8790    my $command = "$dist_make_bundle --camera $camera --stage $stage --stage_id $stage_id";
     91    $command .= " --results_file $rf_name";
    8892    $command .= " --component $component --path_base $path_base --outdir $outdir";
    8993    $command .= " --chip_path_base $chip_path_base" if $chip_path_base;
     
    105109    }
    106110
    107     # parse stdout_buf to get ($file_name, $bytes, $md5sum);
    108     my $metadata = $mdcParser->parse (join "", @$stdout_buf) or
     111    open $rf, "<$rf_name" or &my_die("failed to open results file $rf_name", $dist_id, $component, $PS_EXIT_UNKNOWN_ERROR);
     112
     113    my @lines = (<$rf>);
     114
     115    my $metadata = $mdcParser->parse (join "", @lines) or
    109116        &my_die("Unable to parse metadata config doc", $dist_id, $component, $PS_EXIT_PROG_ERROR);
     117
    110118    my $results = parse_md_list($metadata);
    111119
     
    114122        &my_die("Unexected number of results from dist_make_bundle.pl: $n", $dist_id, $component, $PS_EXIT_PROG_ERROR);
    115123    }
     124    my $result = $results->[0];
    116125
    117     $file_name = $results->{name};
     126    $file_name = $result->{name};
    118127    &my_die("undefined file name from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $file_name;
    119128
    120     $bytes = $results->{bytes};
     129    $bytes = $result->{bytes};
    121130    &my_die("undefined file size from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $bytes;
    122131
    123     $md5sum = $results->{md5sum};
     132    $md5sum = $result->{md5sum};
    124133    &my_die("undefined file md5sum from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $md5sum;
    125134}
Note: See TracChangeset for help on using the changeset viewer.