--- nfo/perl/libs/Data/Rap/Engine.pm 2003/05/13 07:56:12 1.10 +++ nfo/perl/libs/Data/Rap/Engine.pm 2003/06/24 20:59:51 1.12 @@ -1,7 +1,13 @@ ## ---------------------------------------------------------------------- -## $Id: Engine.pm,v 1.10 2003/05/13 07:56:12 joko Exp $ +## $Id: Engine.pm,v 1.12 2003/06/24 20:59:51 jonen Exp $ ## ---------------------------------------------------------------------- ## $Log: Engine.pm,v $ +## Revision 1.12 2003/06/24 20:59:51 jonen +## added option 'detach' +## +## Revision 1.11 2003/06/23 17:54:32 joko +## prepared execution of in-process perl-code via eval (not activated yet!) +## ## Revision 1.10 2003/05/13 07:56:12 joko ## enhanced: *hierarchical* containers for context handling ## fixes: some pre-flight checks @@ -132,12 +138,13 @@ my $content = $entry->{content}; $self->perform_command($command, $args, $content, { warn => 1 } ); # check recursiveness - # new condition: don't recurse if node is flagged to have inline-args (2004-04-17) + # new condition: don't recurse if node is flagged to have inline-args (2003-04-17) my $has_inline_args = ($entry->{attrib}->{_args} && $entry->{attrib}->{_args} eq 'inline'); if ($entry->{content} && ref $entry->{content} && !$has_inline_args) { $self->perform_details($entry); } # new of 2003-05-08 + $command ||= ''; $self->perform_command($command . '_end', undef, undef, { warn => 0 } ); } } @@ -361,6 +368,7 @@ delete $opts->{caption}; delete $opts->{async}; + delete $opts->{detach}; #print Dumper($meta); @@ -421,9 +429,10 @@ # V1.b - enhanced: variable local method $meta->{caption} ||= ''; $meta->{async} ||= 0; + $meta->{detach} ||= 0; # new of 2003-05-08: USE_PATH! $meta->{USE_PATH} ||= 0; - my $evalstr = "run_cmd('$cmd', '$meta->{caption}', { async => $meta->{async}, USE_PATH => $meta->{USE_PATH} });"; + my $evalstr = "run_cmd('$cmd', '$meta->{caption}', { async => $meta->{async}, detach => $meta->{detach}, USE_PATH => $meta->{USE_PATH} });"; eval($evalstr); #my $res = do "$cmd"; #print $res, "\n" if $res; @@ -478,6 +487,16 @@ } elsif ($args->{language} eq 'bash') { $self->log("FIXME: - - - - - -- - - -- BASH - - - - - - - -- - ", 'error'); + + } elsif ($args->{language} eq 'perl') { + + # reporting + #$self->log("Executing some arbitrary unsigned code (probably unsafe). [language=$args->{language}]", 'info'); + #$self->log("\n\n$code\n", 'info'); + + # do it + #eval($code); + #$self->log("\n\n$code\n", 'error') if $@; } else { $self->log("FIXME: Script language '$args->{language}' not implemented.", 'error');