Changeset 22430 for trunk/ippScripts/scripts/magic_destreak.pl
- Timestamp:
- Feb 24, 2009, 12:00:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_destreak.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak.pl
r21435 r22430 26 26 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 27 27 use Pod::Usage qw( pod2usage ); 28 29 # Look for programs we need 30 my $missing_tools; 31 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1); 32 my $streaksremove = can_run('streaksremove') or (warn "Can't find streaksremove" and $missing_tools = 1); 33 if ($missing_tools) { 34 warn("Can't find required tools."); 35 exit($PS_EXIT_CONFIG_ERROR); 36 } 28 37 29 38 # Parse the command-line arguments … … 66 75 defined $component and 67 76 defined $outroot; 68 77 78 # Unhandled exceptions should be passed on to my_die so they get pushed into the database 79 $SIG{__DIE__} = sub { die @_ if $^S; 80 my_die( $_[0], $magic_ds_id, $component, $PS_EXIT_UNKNOWN_ERROR ); }; 81 69 82 70 83 my ($skycell_args, $class_id, $skycell_id); … … 87 100 88 101 89 # Look for programs we need90 my $missing_tools;91 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1);92 my $streaksremove = can_run('streaksremove') or (warn "Can't find streaksremove" and $missing_tools = 1);93 if ($missing_tools) {94 warn("Can't find required tools.");95 exit($PS_EXIT_CONFIG_ERROR);96 }97 98 102 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 99 103 … … 128 132 if (! -e $outroot ) { 129 133 my $code = system "mkdir -p $outroot"; 130 &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 134 &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 131 135 $code >> 8) if $code; 132 136 } … … 143 147 if (! -e $recoveryroot ) { 144 148 my $code = system "mkdir -p $recoveryroot"; 145 &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 149 &my_die("cannot create output directory $outroot", $magic_ds_id, $component, 146 150 $code >> 8) if $code; 147 151 } … … 151 155 152 156 # get skycell list if needed 153 my ($sfh, $skycell_list); 157 my ($sfh, $skycell_list); 154 158 if ($skycell_args) { 155 159 my $command = "$magicdstool -magic_ds_id $magic_ds_id -getskycells $skycell_args";
Note:
See TracChangeset
for help on using the changeset viewer.
