Changeset 22430 for trunk/ippScripts/scripts/stack_skycell.pl
- Timestamp:
- Feb 24, 2009, 12:00:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/stack_skycell.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/stack_skycell.pl
r21371 r22430 29 29 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 30 30 use Pod::Usage qw( pod2usage ); 31 32 # Look for programs we need 33 my $missing_tools; 34 my $stacktool = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1); 35 my $ppStack = can_run('ppStack') or (warn "Can't find ppStack" and $missing_tools = 1); 36 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 37 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 38 if ($missing_tools) { 39 warn("Can't find required tools."); 40 exit($PS_EXIT_CONFIG_ERROR); 41 } 31 42 32 43 my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps); … … 55 66 and defined $run_state; 56 67 68 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 69 $SIG{__DIE__} = sub { die @_ if $^S; 70 my_die( $_[0], $stack_id, $PS_EXIT_UNKNOWN_ERROR ); }; 71 57 72 # XXX camera is not known here; cannot use filerules... 58 73 # my $logDest = $ipprc->filename("LOG.EXP", $outroot); 59 60 74 my $logDest = "$outroot.log"; 61 75 … … 72 86 my $image_id = $stack_id; 73 87 my $source_id = $ipprc->source_id($dbname, $PS_TABLE_ID_STACK); 74 75 # Look for programs we need76 my $missing_tools;77 my $stacktool = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1);78 my $ppStack = can_run('ppStack') or (warn "Can't find ppStack" and $missing_tools = 1);79 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);80 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);81 if ($missing_tools) {82 warn("Can't find required tools.");83 exit($PS_EXIT_CONFIG_ERROR);84 }85 88 86 89 # Get list of components for stacking … … 300 303 301 304 unless ($my_die_called) { 302 $my_die_called = 1;303 delete_temps() unless ($save_temps);305 $my_die_called = 1; 306 delete_temps() unless ($save_temps); 304 307 } 305 308 … … 324 327 { 325 328 unless ($temp_images_exist) { 326 print "No temporary images yet generated\n";327 return 1;329 print "No temporary images yet generated\n"; 330 return 1; 328 331 } 329 332 … … 334 337 unless ($success) { 335 338 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 336 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code);339 &my_die("Unable to perform ppConfigDump: $error_code", $stack_id, $error_code); 337 340 } 338 341 my $md = $mdcParser->parse(join "", @$stdout_buf) or 339 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR);342 &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR); 340 343 341 344 my $temp_delete = metadataLookupBool($md, 'TEMP.DELETE'); # Delete temporary files?
Note:
See TracChangeset
for help on using the changeset viewer.
