X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=a753ab4048f3dbaccf7fb7e5f7ad7074bb0c55f3;hp=a6b773407e4320fa3c55c3e342bc6709e636f526;hb=00e09b5e966914ebedb5c08927cf5a66af177171;hpb=0d54c05d27e53e16bc97eb47d63f11fc85e34f74 diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index a6b7734..a753ab4 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -16,6 +16,7 @@ use CPANPLUS::Error (); use base qw/CPANPLUS::Dist::Base/; +use CPANPLUS::Dist::Gentoo::Atom; use CPANPLUS::Dist::Gentoo::Maps; =head1 NAME @@ -562,14 +563,13 @@ sub _cpan2portage { "$atom-*.ebuild", ) or next; - my $last = reduce { - CPANPLUS::Dist::Gentoo::Maps::version_gcmp($b->[1], $a->[1]) >= 0 ? $b : $a - } map [ $_, /\Q$atom\E-v?([\d._pr-]+).*?\.ebuild$/ ? $1 : 0 ], @ebuilds; + my $last = reduce { $a->[1] < $b->[1] ? $b : $a } + map [ $_, CPANPLUS::Dist::Gentoo::Atom->new(ebuild => $_) ], + @ebuilds; my $dep; if (defined $ver) { # implies that $version is defined - next unless - CPANPLUS::Dist::Gentoo::Maps::version_gcmp($last->[1], $ver) >= 0; + next if $last < $ver; $dep = ">=$category/$atom-$ver"; } else { $dep = "$category/$atom";