Permalink
Browse files

do not claim that a VERSION-less dep is missing

  • Loading branch information...
1 parent e8e25c1 commit 7791bbaf03e8f94c3b02989ade69d9a83d14550f @rjbs committed Mar 30, 2012
Showing with 9 additions and 7 deletions.
  1. +3 −0 Changes
  2. +6 −7 lib/Dist/Zilla/App/Command/listdeps.pm
View
@@ -1,6 +1,9 @@
Revision history for {{$dist->name}}
{{$NEXT}}
+ do not claim that a dep is missing in "listdeps" when it is present
+ with an undef $VERSION and we only require version 0 (reported by
+ Matthew Horsfall)
4.300010 2012-03-15 21:38:58 America/New_York
The GatherDir::Template documentation has been improved
@@ -61,13 +61,12 @@ sub extract_dependencies {
my $mod = shift;
# it is required if it's not already installed
return 1 unless Class::Load::try_load_class($mod);
- # it is required if the version can't be parsed
- # right now $_->VERSION by itself will die if the version can't
- # be parsed, but this may change in the future to only die in that
- # way if an arg is passed
- return 1 if ! try { $mod->VERSION(0); 1 };
- # it is required if the version doesn't meet the requirement
- return !$req->accepts_module($mod => $mod->VERSION);
+
+ # guard against $VERSION = -1 and other insanity
+ my $version;
+ return unless try { $version = $mod->VERSION; 1; };
+
+ return !$req->accepts_module($mod => $version);
};
@required = grep { $is_required->($_) } @required;
}

0 comments on commit 7791bba

Please sign in to comment.