List Info

Thread: setup_home bug (with fix): wrong detection of home directory




setup_home bug (with fix): wrong detection of home directory
user name
2007-09-28 14:16:13
Hello.
 
I put the service script into
APP_HOME/script/service/online_users.plx
 
In the script:
 
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MyApp;
 
print MyApp->path_to(9;/');  # prints APP_HOME/script/service/
 
Fix for Catalyst::Utils (sub Catalyst::Utils::home):
 ;
174,176c174,177
<       ;          my ($lastdir) = $home->dir_list( -1, 1 );
<&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; if ( $lastdir eq '..9; ) {
<&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   $home = dir($home)->parent->parent;
---
>; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  my $i = 0;
>&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; $i++ while $home->dir_list( -$i, 1 ) eq '..9;;
>&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; if ($i) {
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   $home = dir($home)->parent for 1..($i*2);

in my case at line 174 $home = 'APP_HOME/script/service/../../'
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )