From: t0m Date: Fri, 16 Oct 2009 01:54:34 +0000 (+0000) Subject: Use CPAN::Version for version comparison if available so that warnings due to having... X-Git-Tag: 1.006009~57 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe03358f442f762eb8872cbb9ede5b4380493c72;p=p5sagit%2Flocal-lib.git Use CPAN::Version for version comparison if available so that warnings due to having the file::homedir dev release installed shut up git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@7789 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/Changes b/Changes index e0f7770..83d846e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for local::lib + - Use CPAN::Version (if available) to do version comparison for loading + File::HomeDir is it works more correctly with development releases + 1.004008 2009-10-13 - Clarify re-reading the shell config file after writing to it. diff --git a/lib/local/lib.pm b/lib/local/lib.pm index d45ed1d..6b1f5f9 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -157,7 +157,11 @@ sub resolve_home_path { my ($user) = ($path =~ /^~([^\/]+)/); # can assume ^~ so undef for 'us' my $tried_file_homedir; my $homedir = do { - if (eval { require File::HomeDir } && $File::HomeDir::VERSION >= 0.65) { + if ( + eval { require File::HomeDir } + # Use CPAN::Version if available as it deals correctly with dev releases + && (eval { require CPAN::Version; } ? CPAN::Version->vgt($File::HomeDir::VERSION, 0.65) : $File::HomeDir::VERSION >= 0.65 + )) { $tried_file_homedir = 1; if (defined $user) { File::HomeDir->users_home($user);