Author: kwilliams
Date: Mon Sep 10 09:48:22 2007
New Revision: 9929

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Base.pm

Log:
Handle some 0.000 version edge cases

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Mon Sep 10 09:48:22 2007
@@ -1,5 +1,9 @@
 Revision history for Perl extension Module::Build.
 
+ - When a module had 0.000 as its version, a few places in the code
+   thought the module had no version at all.  This is now
+   fixed. [Andrew "Zefram" Main]
+
  - When finding the default set of script_files, we now compute them
    as relative paths, not absolute. [Spotted by Curtis "Ovid" Poe]
 

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Mon Sep 10 09:48:22 2007
@@ -954,7 +954,7 @@
 
   die ("Can't determine distribution version, must supply either 
'dist_version',\n".
        "'dist_version_from', or 'module_name' parameter")
-    unless $p->{dist_version};
+    unless defined $p->{dist_version};
 
   return $p->{dist_version};
 }
@@ -1223,7 +1223,7 @@
     }
     
     $status{have} = $pm_info->version();
-    if ($spec and !$status{have}) {
+    if ($spec and !defined($status{have})) {
       @status{ qw(have message) } = (undef, "Couldn't find a \$VERSION in 
prerequisite $modname");
       return \%status;
     }
@@ -1978,7 +1978,8 @@
       my $vspace = q{ } x ($ver_len - length $mod->{need});
       my $f = $mod->{ok} ? ' ' : '!';
       $output .=
-        "  $f $mod->{name} $space     $mod->{need}  $vspace   $mod->{have}\n";
+        "  $f $mod->{name} $space     $mod->{need}  $vspace   ".
+        (defined($mod->{have}) ? $mod->{have} : "")."\n";
     }
   }
   return $output;

Reply via email to