Changeset 22430 for trunk/ippScripts/scripts/magic_process.pl
- Timestamp:
- Feb 24, 2009, 12:00:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_process.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_process.pl
r21371 r22430 28 28 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 29 29 use Pod::Usage qw( pod2usage ); 30 31 # Look for programs we need 32 my $missing_tools; 33 my $magictool = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1); 34 my $removestreaks = can_run('RemoveStreaks') or (warn "Can't find RemoveStreaks" and $missing_tools = 1); 35 if ($missing_tools) { 36 warn("Can't find required tools."); 37 exit($PS_EXIT_CONFIG_ERROR); 38 } 30 39 31 40 # Parse the command-line arguments … … 53 62 defined $outroot; 54 63 64 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 65 $SIG{__DIE__} = sub { die @_ if $^S; 66 my_die( $_[0], $magic_id, $node, $PS_EXIT_UNKNOWN_ERROR ); }; 67 55 68 $ipprc->define_camera($camera); 56 69 … … 66 79 # resolve any path:// or file:// in outroot 67 80 $outroot = $ipprc->file_resolve($outroot); 68 81 69 82 $ipprc->redirect_output($logfile) if $logfile; 70 71 # Look for programs we need72 my $missing_tools;73 my $magictool = can_run('magictool') or (warn "Can't find magictool" and $missing_tools = 1);74 my $removestreaks = can_run('RemoveStreaks') or (warn "Can't find RemoveStreaks" and $missing_tools = 1);75 if ($missing_tools) {76 warn("Can't find required tools.");77 exit($PS_EXIT_CONFIG_ERROR);78 }79 83 80 84 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files … … 145 149 # this causes major file pollution, but avoids multi-level queries 146 150 # at higher level nodes. 147 151 148 152 my ($in_fh, $input_list) = open_list_file($outroot, "input.list"); 149 153 print $in_fh "$outroot\n"; … … 252 256 253 257 my $fh; 254 open $fh, "<$resolved" or 258 open $fh, "<$resolved" or 255 259 &my_die("failed to open streaks file $streaks_file", $magic_id, $node, $PS_EXIT_UNKNOWN_ERROR); 256 260 # the first line in the streaks file contains the number of streaks found … … 259 263 close $fh; 260 264 print "$num_streaks streaks found on magicRun $magic_id\n" if $verbose; 261 265 262 266 my $command = "$magictool -addmask"; 263 267 $command .= " -magic_id $magic_id";
Note:
See TracChangeset
for help on using the changeset viewer.
