[Jifty-commit] r5087 - jifty/trunk/lib/Jifty
Jifty commits
jifty-commit at lists.jifty.org
Sat Feb 9 18:07:49 EST 2008
Author: audreyt
Date: Sat Feb 9 18:07:48 2008
New Revision: 5087
Modified:
jifty/trunk/lib/Jifty/Util.pm
Log:
* Jifty::Util::app_root - File::Spec::Win32's catdir() just got
much more strict in PathTools 3.27, such that:
catdir('C:', 'perl')
Now returns 'C:perl' instead of 'C:\perl'. Code around it
using a few catpath() calls to deal with the volume part.
(This is not the whole story; a new Class::Inspector release
would be needed for File::HomeDir to work on Win32 too.)
Modified: jifty/trunk/lib/Jifty/Util.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Util.pm (original)
+++ jifty/trunk/lib/Jifty/Util.pm Sat Feb 9 18:07:48 2008
@@ -147,10 +147,11 @@
Jifty::Util->require('ExtUtils::MM') if $^O =~ /(?:MSWin32|cygwin|os2)/;
Jifty::Util->require('Config');
- for (@roots) {
- my @root = File::Spec->splitdir($_);
+ for my $root_path (@roots) {
+ my ($volume, $dirs) = File::Spec->splitpath($root_path, 'no_file');
+ my @root = File::Spec->splitdir($dirs);
while (@root) {
- my $try = File::Spec->catdir( @root, "bin", "jifty" );
+ my $try = File::Spec->catpath($volume, File::Spec->catdir( @root, "bin", "jifty" ));
if (# XXX: Just a quick hack
# MSWin32's 'maybe_command' sees only file extension.
# Maybe we should check 'jifty.bat' instead on Win32,
@@ -163,7 +164,7 @@
and lc($try) ne lc(File::Spec->catdir($Config::Config{bin}, "jifty"))
and lc($try) ne lc(File::Spec->catdir($Config::Config{scriptdir}, "jifty")) )
{
- return $APP_ROOT = File::Spec->catdir(@root);
+ return $APP_ROOT = File::Spec->catpath($volume, File::Spec->catdir(@root));
}
pop @root;
}
More information about the Jifty-commit
mailing list