- 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;