| 2 |
## $Id$ |
## $Id$ |
| 3 |
## ---------------------------------------------------------------------- |
## ---------------------------------------------------------------------- |
| 4 |
## $Log$ |
## $Log$ |
| 5 |
|
## Revision 1.15 2004/06/16 16:37:59 joko |
| 6 |
|
## attempt to get things going in a generic way (Linux/FreeBSD/Win32) |
| 7 |
|
## |
| 8 |
|
## Revision 1.14 2004/05/12 14:23:31 jonen |
| 9 |
|
## add comment/code related to PERL5LIB var at different OS's |
| 10 |
|
## |
| 11 |
|
## Revision 1.13 2003/12/05 05:02:08 joko |
| 12 |
|
## + minor update: disabled some unnecessary loggers or changed to debug-level |
| 13 |
|
## |
| 14 |
## Revision 1.12 2003/06/24 20:59:51 jonen |
## Revision 1.12 2003/06/24 20:59:51 jonen |
| 15 |
## added option 'detach' |
## added option 'detach' |
| 16 |
## |
## |
| 66 |
use Hash::Merge qw( merge ); |
use Hash::Merge qw( merge ); |
| 67 |
use Iterate; |
use Iterate; |
| 68 |
|
|
| 69 |
use shortcuts qw( run_cmd ); |
use shortcuts qw( run_cmd RUNNING_IN_HELL ); |
| 70 |
use Data::Mungle::Code::Ref qw( ref_slot ); |
use Data::Mungle::Code::Ref qw( ref_slot ); |
| 71 |
use Data::Mungle::Transform::Deep qw( expand deep_copy ); |
use Data::Mungle::Transform::Deep qw( expand deep_copy ); |
| 72 |
use File::Temp qw/ tempfile tempdir /; |
use File::Temp qw/ tempfile tempdir /; |
| 73 |
|
|
| 74 |
|
my $DEBUG = 0; |
| 75 |
|
|
| 76 |
sub performTarget { |
sub performTarget { |
| 77 |
my $self = shift; |
my $self = shift; |
| 99 |
#$self->log($header, 'notice'); |
#$self->log($header, 'notice'); |
| 100 |
|
|
| 101 |
# V3 |
# V3 |
| 102 |
$self->log("- " x 20, 'info'); |
#$self->log("- " x 20, 'info'); |
| 103 |
$self->log("Performing Target '$targetname'.", 'notice'); |
$self->log("Performing Target '$targetname'.", 'notice'); |
| 104 |
|
|
| 105 |
#exit; |
#exit; |
| 172 |
my $options = shift; |
my $options = shift; |
| 173 |
|
|
| 174 |
if (!$command) { |
if (!$command) { |
| 175 |
$self->log("Command was empty!", 'debug'); |
$self->log("Command was empty!", 'debug') if $DEBUG; |
| 176 |
return; |
return; |
| 177 |
} |
} |
| 178 |
|
|
| 179 |
# FIXME: make '__PACKAGE__' go one level deeper properly! |
# FIXME: make '__PACKAGE__' go one level deeper properly! |
| 180 |
$self->log( __PACKAGE__ . "->perform_command: " . $command, 'debug'); |
$self->log( __PACKAGE__ . "->perform_command: " . $command, 'debug') if $DEBUG; |
| 181 |
|
|
| 182 |
|
|
| 183 |
# 1. make arguments from list of arguments(?) |
# 1. make arguments from list of arguments(?) |
| 220 |
} else { |
} else { |
| 221 |
my $level = "debug"; |
my $level = "debug"; |
| 222 |
$level = "warning" if $options->{warn}; |
$level = "warning" if $options->{warn}; |
| 223 |
$self->log("Command '$command' not implemented.", $level); |
$self->log("Command '$command' not implemented.", $level) if $DEBUG; |
| 224 |
} |
} |
| 225 |
|
|
| 226 |
} |
} |
| 347 |
|
|
| 348 |
$name = '__rap.properties.' . $name; |
$name = '__rap.properties.' . $name; |
| 349 |
|
|
| 350 |
$self->log("get-name: $name"); |
$self->log("get-name: $name") if $DEBUG; |
| 351 |
|
|
| 352 |
# get property slot and return value |
# get property slot and return value |
| 353 |
$result = ref_slot($self, $name, undef, '.'); |
$result = ref_slot($self, $name, undef, '.'); |
| 423 |
#print "command: $cmd", "\n"; |
#print "command: $cmd", "\n"; |
| 424 |
|
|
| 425 |
# start process |
# start process |
| 426 |
# V1: via shortcut |
# 2004-05-11 - seems like only ONE args is valid at PERL5LIB, so we use V2! |
| 427 |
#$ENV{PERL5LIB} = join(' ', @INC); |
# 2004-06-16 - found out delimiter required for PERL5LIB, reverting back to V1! |
| 428 |
|
|
| 429 |
# FIXME!!! what about the other slots of @INC? |
# V1: join all args |
| 430 |
$ENV{PERL5LIB} = $INC[0]; |
my $delimiter = ':'; |
| 431 |
|
$delimiter = ';' if RUNNING_IN_HELL(); |
| 432 |
|
$ENV{PERL5LIB} = join($delimiter, @INC); |
| 433 |
|
# V2: insert only FIRST arg |
| 434 |
|
#$ENV{PERL5LIB} = $INC[0]; |
| 435 |
|
# WARNING: at (free)BSD our var is the SECOND, NOT FIRST!! |
| 436 |
|
# FIXME!! Do this in an abstract way!! |
| 437 |
|
#$ENV{PERL5LIB} = $INC[1]; |
| 438 |
|
|
| 439 |
#print Dumper(%ENV); |
#print Dumper(%ENV); |
| 440 |
|
|