use base qw/CPANPLUS::Dist::Base/;
+use CPANPLUS::Dist::Gentoo::Atom;
use CPANPLUS::Dist::Gentoo::Maps;
=head1 NAME
"$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";