Changeset 214
- Timestamp:
- 03/29/06 22:13:26 (18 years ago)
- Location:
- trunk/soft/ObsData
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/ObsData/ObsData.pm
r211 r214 404 404 } 405 405 406 sub postprocessed { 407 my ($self) = @_; 408 my %datastype; 409 foreach my $entry (@{$self->{processed_lists}}) { 410 push(@{$datastype{$entry->{datatype}}}, $entry); 411 } 412 413 foreach my $datatype (keys %datastype) { 414 my $command = $self->getvalue($datatype, 'postexec'); 415 $self->logging(0, 'postexec for %s is %s', 416 $datatype, 417 $command ? "`$command'" : 'not set, skipping', 418 ); 419 if ($command) { 420 if (open(my $posthandle, "| $command")) { 421 foreach (@{$datastype{$datatype}}) { 422 print $posthandle "$_->{destfile}\n" or do { 423 $self->logging(4, "cannot write to postexec handle for `%s': %s", 424 $datatype, 425 $!, 426 ); 427 last; 428 }; 429 } 430 my $exitstatus = close($posthandle); 431 $self->logging($exitstatus ? 0 : 4, 432 "postexec for %s exit %s", 433 $datatype, 434 $exitstatus ? "correctly" : "with failure : " . ($! ? ($!) : "(??)"), 435 ); 436 } else { 437 $self->logging(4, "Cannot exec post `%s' for `%s'", 438 $command, 439 $datatype, 440 ); 441 next; 442 } 443 } 444 } 445 } 446 406 447 1; 407 448 -
trunk/soft/ObsData/bin/obsdata
r211 r214 132 132 133 133 my $s = $obsdata->generated_reported(); 134 135 134 $s = $obsdata->postprocessed(); 136 135 137 136 =head1 AUTHOR -
trunk/soft/ObsData/testdata/obsdata-conftest
r211 r214 18 18 dest=%s/dest%s 19 19 reportto=nanardon@nanardon.zarb.org 20 postexec=cat > postexec.log 20 21 21 22 [oxygene]
Note: See TracChangeset
for help on using the changeset viewer.