Changeset 26044
- Timestamp:
- Nov 5, 2009, 10:22:11 AM (17 years ago)
- Location:
- trunk/ippScripts/scripts
- Files:
-
- 2 edited
-
dist_bundle.pl (modified) (3 diffs)
-
dist_component.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/dist_bundle.pl
r26042 r26044 8 8 use Sys::Hostname; 9 9 my $host = hostname(); 10 print "\n\n";11 print "Starting script $0 on $host\n\n";10 # print "\n\n"; 11 # print "Starting script $0 on $host\n\n"; 12 12 13 13 use vars qw( $VERSION ); … … 60 60 # Parse the command-line arguments 61 61 my ($camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean); 62 my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality );62 my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file); 63 63 my ($dbname, $save_temps, $verbose, $no_update, $logfile); 64 64 65 65 GetOptions( 66 'results_file=s' => \$results_file, # camera for evaluating file rules 66 67 'camera=s' => \$camera, # camera for evaluating file rules 67 68 'stage=s' => \$stage, # raw, chip, warp, or diff … … 303 304 } 304 305 305 print "bundleResults MULTI\n\n"; 306 print "bundleResults METADATA\n"; 307 print " name STR $file_name\n"; 308 print " bytes S64 $bytes\n"; 309 print " md5sum STR $md5sum\n"; 310 print "END\n\n"; 306 if ($results_file) { 307 open RF, ">$results_file" or &my_die("unable to open results file $results_file", $component, $PS_EXIT_UNKNOWN_ERROR); 308 print RF "bundleResults MULTI\n\n"; 309 print RF "bundleResults METADATA\n"; 310 print RF " name STR $file_name\n"; 311 print RF " bytes S64 $bytes\n"; 312 print RF " md5sum STR $md5sum\n"; 313 print RF "END\n\n"; 314 315 close RF; 316 } 311 317 312 318 exit 0; -
trunk/ippScripts/scripts/dist_component.pl
r26043 r26044 83 83 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 84 84 85 my ($rf, $rf_name) = tempfile("/tmp/bundleresults.$dist_id.$component.XXXX", UNLINK => !$save_temps); 86 close $rf; 87 85 88 my ($file_name, $bytes, $md5sum); 86 89 { 87 90 my $command = "$dist_make_bundle --camera $camera --stage $stage --stage_id $stage_id"; 91 $command .= " --results_file $rf_name"; 88 92 $command .= " --component $component --path_base $path_base --outdir $outdir"; 89 93 $command .= " --chip_path_base $chip_path_base" if $chip_path_base; … … 105 109 } 106 110 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 109 116 &my_die("Unable to parse metadata config doc", $dist_id, $component, $PS_EXIT_PROG_ERROR); 117 110 118 my $results = parse_md_list($metadata); 111 119 … … 114 122 &my_die("Unexected number of results from dist_make_bundle.pl: $n", $dist_id, $component, $PS_EXIT_PROG_ERROR); 115 123 } 124 my $result = $results->[0]; 116 125 117 $file_name = $result s->{name};126 $file_name = $result->{name}; 118 127 &my_die("undefined file name from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $file_name; 119 128 120 $bytes = $result s->{bytes};129 $bytes = $result->{bytes}; 121 130 &my_die("undefined file size from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $bytes; 122 131 123 $md5sum = $result s->{md5sum};132 $md5sum = $result->{md5sum}; 124 133 &my_die("undefined file md5sum from dist_bundle.pl", $dist_id, $component, $PS_EXIT_PROG_ERROR) unless defined $md5sum; 125 134 }
Note:
See TracChangeset
for help on using the changeset viewer.
