[Bast-commits] r7789 - in local-lib/1.000/trunk: . lib/local

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Fri Oct 16 01:54:34 GMT 2009


Author: t0m
Date: 2009-10-16 01:54:34 +0000 (Fri, 16 Oct 2009)
New Revision: 7789

Modified:
   local-lib/1.000/trunk/Changes
   local-lib/1.000/trunk/lib/local/lib.pm
Log:
Use CPAN::Version for version comparison if available so that warnings due to having the file::homedir dev release installed shut up

Modified: local-lib/1.000/trunk/Changes
===================================================================
--- local-lib/1.000/trunk/Changes	2009-10-14 17:43:51 UTC (rev 7788)
+++ local-lib/1.000/trunk/Changes	2009-10-16 01:54:34 UTC (rev 7789)
@@ -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.

Modified: local-lib/1.000/trunk/lib/local/lib.pm
===================================================================
--- local-lib/1.000/trunk/lib/local/lib.pm	2009-10-14 17:43:51 UTC (rev 7788)
+++ local-lib/1.000/trunk/lib/local/lib.pm	2009-10-16 01:54:34 UTC (rev 7789)
@@ -157,7 +157,11 @@
   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);




More information about the Bast-commits mailing list