X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=307d802108c903dfda523ba9ce864ef69a7498f3;hb=4e0c9cad73c65d6c469d35afebbef746ab15ce89;hp=3bc66a54e33b26ac96ae0d712f4be150d7a3cf7c;hpb=5a5575483b3f3ae59a3895e1a571edd687becec0;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 3bc66a5..307d802 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -85,7 +85,7 @@ Log in as root and unpack them in e.g. your home directory : Set up environment variables so that the toolchain is temporarily available : # export OLDPATH=$PATH - # export PATH=/root/CPANPLUS-Dist-Gentoo-0.08/bin:$PATH + # export PATH=/root/CPANPLUS-0.88/bin:$PATH # export PERL5LIB=/root/CPANPLUS-Dist-Gentoo-0.08/blib/lib:/root/CPANPLUS-0.88/lib:/root/CPANPLUS-0.88/inc/bundle Make sure you don't have an old C<.cpanplus> configuration visible : @@ -566,20 +566,17 @@ sub _cpan2portage { "$name-*.ebuild", ) or next; - my @atoms = map CPANPLUS::Dist::Gentoo::Atom->new( - defined $version ? ( - ebuild => $_, - range => '>=', - ) : ( - category => $category, - name => $name, - ), - ), @ebuilds; + my $last = reduce { $a < $b ? $b : $a } # handles overloading + map CPANPLUS::Dist::Gentoo::Atom->new_from_ebuild($_), + @ebuilds; + next if defined $version and $last < $version; - my $atom = reduce { $a < $b ? $b : $a } @atoms; # handles overloading - next if defined $version and $atom < $version; - - return $atom; + return CPANPLUS::Dist::Gentoo::Atom->new( + category => $last->category, + name => $last->name, + (defined $version ? (version => $version, range => '>=') : ()), + ebuild => $last->ebuild, + ); } }