Changeset 32779
- Timestamp:
- Nov 23, 2011, 11:40:28 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/videophot_process.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/videophot_process.pl
r32749 r32779 32 32 my $listvideocells = can_run('listvideocells.pl') or (warn "Can't find listvideocells.pl" and $missing_tools = 1); 33 33 my $dsreg = can_run('dsreg') or (warn "Can't find dsreg" and $missing_tools = 1); 34 my $nebrepair = can_run('neb-repair') or (warn "Can't find neb-repair" and $missing_tools = 1); 34 35 if ($missing_tools) { 35 36 warn("Can't find required tools."); … … 116 117 run(command => $command, verbose => $verbose); 117 118 unless ($success) { 119 check_input_file($uri, $vp_id, $class_id, 'nocell'); 118 120 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 119 121 &my_die("Unable to perform $command: $error_code", $vp_id, $error_code); … … 135 137 run(command => $command, verbose => $verbose); 136 138 unless ($success) { 139 check_input_file($uri, $vp_id, $class_id, $cell_id); 137 140 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 138 141 &my_die("Unable to perform psvideophot: $error_code", $vp_id, $error_code); … … 244 247 exit 0; 245 248 249 sub check_input_file { 250 my $uri = shift; 251 my $vp_id = shift; 252 my $class_id = shift; 253 my $cell_id = shift; 254 my $resolved = $ipprc->file_resolve($uri); 255 256 my $tryrepair = 0; 257 if (!-e $resolved) { 258 printf STDERR "instance $resolved for $uri does not exist\n"; 259 $tryrepair = 1; 260 } elsif (-s $resolved == 0) { 261 printf STDERR "instance $resolved for $uri is empty\n"; 262 $tryrepair = 1; 263 } 264 if ($tryrepair) { 265 my $scheme = file_scheme($uri); 266 if ($scheme and ($scheme = 'neb')) { 267 my $command = "$nebrepair $uri"; 268 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 269 run(command => $command, verbose => $verbose); 270 unless ($success) { 271 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 272 my $err_message = "Unable to perform nebrepair"; 273 &my_die("$err_message: $error_code", $vp_id, $error_code); 274 } 275 } 276 } 277 } 278 246 279 sub my_die 247 280 {
Note:
See TracChangeset
for help on using the changeset viewer.
