Changeset 21145
- Timestamp:
- Jan 21, 2009, 10:47:12 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/stack_skycell.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/stack_skycell.pl
r21015 r21145 241 241 &my_die("Couldn't find expected output file: $outputStats", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal; 242 242 243 # measure chipstats243 # measure stats 244 244 $command = "$ppStatsFromMetadata $outputStatsReal - STACK_SKYCELL"; 245 245 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 255 255 } 256 256 } 257 258 delete_temps() unless ($save_temps); 257 259 258 260 unless ($no_update) { … … 285 287 286 288 289 287 290 sub my_die 288 291 { … … 293 296 carp($msg); 294 297 295 unless ($save_temps) { 296 print "Ensuring temporary images are deleted.\n"; 297 delete_temps(); 298 } 298 delete_temps() unless ($save_temps); 299 299 300 300 if (defined $stack_id and not $no_update) { … … 317 317 sub delete_temps 318 318 { 319 print "Ensuring temporary images are deleted.\n"; 319 320 my $command = "$ppConfigDump -camera $camera -recipe PPSTACK $recipe_ppStack -dump-recipe PPSTACK -"; 320 321 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 321 run(command => $command, verbose => $verbose);322 run(command => $command, verbose => $verbose); 322 323 unless ($success) { 323 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);324 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code);324 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 325 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code); 325 326 } 326 327 my $md = $mdcParser->parse(join "", @$stdout_buf) or 327 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR);328 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 328 329 329 330 my $temp_delete = metadataLookupBool($md, 'TEMP.DELETE'); # Delete temporary files? 330 331 if ($temp_delete) { 331 my $temp_dir = metadataLookupStr($md, 'TEMP.DIR'); # Directory with temporary files332 my $temp_image = metadataLookupStr($md, 'TEMP.IMAGE'); # Suffix for image333 my $temp_mask = metadataLookupStr($md, 'TEMP.MASK'); # Suffix for mask334 my $temp_weight = metadataLookupStr($md, 'TEMP.WEIGHT'); # Suffix for weight335 my $temp_root = basename($outroot); # Root name for temporary files336 337 if (not defined $temp_dir or not defined $temp_image or not defined $temp_mask or 338 not defined $temp_weight) {339 &my_die("Unable to find details for temporary images.", $stack_id, $PS_EXIT_CONFIG_ERROR);340 }341 342 for (my $i = 0; $i < $num; $i++) {343 foreach my $ext ( $temp_image, $temp_mask, $temp_weight ) {344 my $file = $temp_dir . '/' . $temp_root . '.' . $i . '.' . $ext;345 unlink $file if -e $file;346 }347 }332 my $temp_dir = metadataLookupStr($md, 'TEMP.DIR'); # Directory with temporary files 333 my $temp_image = metadataLookupStr($md, 'TEMP.IMAGE'); # Suffix for image 334 my $temp_mask = metadataLookupStr($md, 'TEMP.MASK'); # Suffix for mask 335 my $temp_weight = metadataLookupStr($md, 'TEMP.WEIGHT'); # Suffix for weight 336 my $temp_root = basename($outroot); # Root name for temporary files 337 338 if (not defined $temp_dir or not defined $temp_image or not defined $temp_mask or 339 not defined $temp_weight) { 340 &my_die("Unable to find details for temporary images.", $stack_id, $PS_EXIT_CONFIG_ERROR); 341 } 342 343 for (my $i = 0; $i < $num; $i++) { 344 foreach my $ext ( $temp_image, $temp_mask, $temp_weight ) { 345 my $file = $temp_dir . '/' . $temp_root . '.' . $i . '.' . $ext; 346 unlink $file if -e $file; 347 } 348 } 348 349 } 349 350 }
Note:
See TracChangeset
for help on using the changeset viewer.
