- Timestamp:
- Jun 12, 2026, 2:47:49 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/psmkreq
r43048 r43052 12 12 use Getopt::Long qw( GetOptions ) ; # :config auto_help auto_version gnu_getopt ); 13 13 use Pod::Usage qw( pod2usage ); 14 use PS::IPP::Config qw( :standard );14 use PS::IPP::Config qw( :standard ps_run ); 15 15 use PS::IPP::PStamp::RequestFile qw( :standard ); 16 16 use PS::IPP::PStamp::Job qw( :standard ); 17 17 use File::Temp qw(tempfile); 18 18 use File::Basename qw(basename); 19 use Scalar::Util qw(looks_like_number); 20 use IPC::Cmd 0.36 qw( can_run run ); 19 use IPC::Cmd 0.36 qw( can_run ); 21 20 use Carp; 22 21 use POSIX; … … 296 295 my $command = "$pstamp_request_file --input $table_def_name --req_name $req_name"; 297 296 $command .= " --output $output" if $output; 298 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = 299 run(command => $command, verbose => $verbose); 300 my $error_code = &parse_error_message ($success, $error_msg, $command); 297 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 298 ps_run(command => $command, verbose => $verbose); 301 299 unless ($success) { 302 300 print STDERR @$stderr_buf; 303 exit $error_code ;301 exit $error_code >>8; 304 302 } 305 303 } … … 450 448 } 451 449 452 # if the program exited normally, the exit value is returned453 # if the program exited with a signal (abort, crash, etc), PS_EXIT_PROG_ERROR (4) is returned454 # if the program failed to run, -PS_EXIT_PROG_ERROR (-4) is returned455 sub parse_error_message {456 my $success = shift;457 my $error_msg = shift;458 my $command = shift;459 460 if ($success) { return 0; }461 462 print "raw error_msg: $error_msg\n";463 print "full command: $command\n";464 465 if (&looks_like_number($error_msg)) { return (($error_msg >> 8) or ($PS_EXIT_PROG_ERROR)); }466 467 # which of these match?468 my ($error_code) = $error_msg =~ m/exited with value (\d+)/;469 if (defined $error_code) { return $error_code; }470 471 ($error_code) = $error_msg =~ m/died with signal (\d+)/;472 # if (defined $error_code) { return (128 + $error_code); }473 if (defined $error_code) { return ($PS_EXIT_PROG_ERROR); }474 475 # probably failed to execute:476 return (-1*$PS_EXIT_PROG_ERROR);477 }478
Note:
See TracChangeset
for help on using the changeset viewer.
