From 3bdc584ef8f0c2d2b378e715bd56bb01b55cecb1 Mon Sep 17 00:00:00 2001 From: Justin Davis Date: Thu, 29 Dec 2011 15:49:50 -0500 Subject: Filter out deps on core modules, again. The extra dependencies bug me... --- lib/metas/perl.d/perl-dist | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/metas/perl.d/perl-dist b/lib/metas/perl.d/perl-dist index 7c64380..30eda37 100755 --- a/lib/metas/perl.d/perl-dist +++ b/lib/metas/perl.d/perl-dist @@ -174,14 +174,19 @@ sub _reqs2deps my ($prereqs) = @_; my (@mods, %pkgdeps); - CPAN_DEP_LOOP: + # Filter out deps on 'perl' and any core modules that we can. while(my ($name, $ver) = each(%$prereqs)) { - # Sometimes a perl version is given as a prerequisite + my $cver = $Module::CoreList::version{$]}{$name}; if($name eq 'perl') { $pkgdeps{'perl'} = _perldepver($ver); - next CPAN_DEP_LOOP; + }elsif($cver && !$ver + || version->parse($ver) > version->parse($cver)){ + # Only add deps for core modules if we need a higher + # version than what is in the core for our perl interpreter. + ; + }else{ + push @mods, $name; } - push @mods, $name; } my %dists = _distsofmods(@mods); -- cgit v1.2.3-24-g4f1b