/[cvs]/nfo/perl/libs/Data/Rap/Engine.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Rap/Engine.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by jonen, Tue Jun 24 20:59:51 2003 UTC revision 1.16 by jonen, Mon Jun 21 14:15:06 2004 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ----------------------------------------------------------------------  ## ----------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.16  2004/06/21 14:15:06  jonen
6    ##  handle path-modifications in a generic way now(fix for BSD)
7    ##
8    ##  Revision 1.15  2004/06/16 16:37:59  joko
9    ##  attempt to get things going in a generic way (Linux/FreeBSD/Win32)
10    ##
11    ##  Revision 1.14  2004/05/12 14:23:31  jonen
12    ##   add comment/code related to PERL5LIB var at different OS's
13    ##
14    ##  Revision 1.13  2003/12/05 05:02:08  joko
15    ##  + minor update: disabled some unnecessary loggers or changed to debug-level
16    ##
17  ##  Revision 1.12  2003/06/24 20:59:51  jonen  ##  Revision 1.12  2003/06/24 20:59:51  jonen
18  ##  added option 'detach'  ##  added option 'detach'
19  ##  ##
# Line 57  use Data::Dumper; Line 69  use Data::Dumper;
69  use Hash::Merge qw( merge );  use Hash::Merge qw( merge );
70  use Iterate;  use Iterate;
71    
72  use shortcuts qw( run_cmd );  use shortcuts qw( run_cmd RUNNING_IN_HELL RUNNING_IN_HEAVEN );
73  use Data::Mungle::Code::Ref qw( ref_slot );  use Data::Mungle::Code::Ref qw( ref_slot );
74  use Data::Mungle::Transform::Deep qw( expand deep_copy );  use Data::Mungle::Transform::Deep qw( expand deep_copy );
75  use File::Temp qw/ tempfile tempdir /;  use File::Temp qw/ tempfile tempdir /;
76    
77    my $DEBUG = 0;
78    
79  sub performTarget {  sub performTarget {
80    my $self = shift;    my $self = shift;
# Line 89  sub perform_target { Line 102  sub perform_target {
102    #$self->log($header, 'notice');    #$self->log($header, 'notice');
103    
104    # V3    # V3
105    $self->log("- " x 20, 'info');    #$self->log("- " x 20, 'info');
106    $self->log("Performing Target '$targetname'.", 'notice');    $self->log("Performing Target '$targetname'.", 'notice');
107    
108    #exit;    #exit;
# Line 162  sub perform_command { Line 175  sub perform_command {
175    my $options = shift;    my $options = shift;
176    
177    if (!$command) {    if (!$command) {
178      $self->log("Command was empty!", 'debug');      $self->log("Command was empty!", 'debug') if $DEBUG;
179      return;      return;
180    }    }
181    
182    # FIXME: make '__PACKAGE__' go one level deeper properly!    # FIXME: make '__PACKAGE__' go one level deeper properly!
183    $self->log( __PACKAGE__ . "->perform_command: " . $command, 'debug');    $self->log( __PACKAGE__ . "->perform_command: " . $command, 'debug') if $DEBUG;
184        
185        
186    # 1. make arguments from list of arguments(?)    # 1. make arguments from list of arguments(?)
# Line 210  sub perform_command { Line 223  sub perform_command {
223    } else {    } else {
224      my $level = "debug";      my $level = "debug";
225      $level = "warning" if $options->{warn};      $level = "warning" if $options->{warn};
226      $self->log("Command '$command' not implemented.", $level);      $self->log("Command '$command' not implemented.", $level) if $DEBUG;
227    }    }
228        
229  }  }
# Line 337  sub get_property { Line 350  sub get_property {
350    
351      $name = '__rap.properties.' . $name;      $name = '__rap.properties.' . $name;
352            
353      $self->log("get-name: $name");      $self->log("get-name: $name") if $DEBUG;
354            
355      # get property slot and return value      # get property slot and return value
356      $result = ref_slot($self, $name, undef, '.');      $result = ref_slot($self, $name, undef, '.');
# Line 413  sub run_executable { Line 426  sub run_executable {
426        #print "command: $cmd", "\n";        #print "command: $cmd", "\n";
427            
428      # start process      # start process
429        # V1: via shortcut        # 2004-05-11 - seems like only ONE args is valid at PERL5LIB, so we use V2!
430        #$ENV{PERL5LIB} = join(' ', @INC);        # 2004-06-16 - found out delimiter required for PERL5LIB, reverting back to V1!
431                
432        # FIXME!!! what about the other slots of @INC?        # V1: join all args
433        $ENV{PERL5LIB} = $INC[0];        #my $delimiter = ':';
434          #$delimiter = ';' if RUNNING_IN_HELL();
435          #$ENV{PERL5LIB} = join($delimiter, @INC);
436          # V2: insert only FIRST arg
437          #$ENV{PERL5LIB} = $INC[0];
438          # WARNING: at (free)BSD our var is the SECOND, NOT FIRST!!
439          # FIXME!! Do this in an abstract way!!
440          #$ENV{PERL5LIB} = $INC[1];
441          # V3: mix V1+V2 (because V1 doesn't fit at freeBSD..)
442          if(RUNNING_IN_HEAVEN()) {
443            $ENV{PERL5LIB} = $INC[1];
444          } else {
445            my $delimiter = ':';
446            $delimiter = ';' if RUNNING_IN_HELL();
447            $ENV{PERL5LIB} = join($delimiter, @INC);
448          }
449                
450        #print Dumper(%ENV);        #print Dumper(%ENV);
451                

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.16

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed