--- nfo/perl/libs/Data/Rap.pm 2003/03/27 15:31:01 1.4 +++ nfo/perl/libs/Data/Rap.pm 2003/03/28 16:52:41 1.5 @@ -1,7 +1,10 @@ ## ------------------------------------------------------------------------- -## $Id: Rap.pm,v 1.4 2003/03/27 15:31:01 joko Exp $ +## $Id: Rap.pm,v 1.5 2003/03/28 16:52:41 jonen Exp $ ## ------------------------------------------------------------------------- ## $Log: Rap.pm,v $ +## Revision 1.5 2003/03/28 16:52:41 jonen +## now using env-var 'RAPBIN' +## ## Revision 1.4 2003/03/27 15:31:01 joko ## fixes to modules regarding new namespace(s) below Data::Mungle::* ## @@ -179,6 +182,9 @@ #$self->load("Command"); #$self->load("Metadata"); #$self->load("Engine"); + + # check for another environment-variable: 'RAPBIN' + chdir $ENV{RAPBIN} if $ENV{RAPBIN}; } @@ -225,15 +231,22 @@ sub find_rules { my $self = shift; - my $cwd = cwd(); - (my $volume, my $directory, my $file) = splitpath( $cwd ); - my @dir = splitdir($directory); - pop @dir; - #pop @dir; - my $base = catpath($volume, catdir(@dir)); + my $basedir; + if (my $rapdir = $ENV{RAPDIR}) { + $basedir = $rapdir; + } else { + my $cwd = cwd(); + + (my $volume, my $directory, my $file) = splitpath( $cwd ); + my @dir = splitdir($directory); + pop @dir; + #pop @dir; + $basedir = catpath($volume, catdir(@dir)); + + } - my $rap_xml = "$base/etc/rap.xml"; + my $rap_xml = "$basedir/etc/rap.xml"; return $rap_xml; }