X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo%2FMaps.pm;h=d4a3fe6fae239eb28f0c62b7840629bac6c61302;hp=5323307c5f816828ad3a6c0b337d53dab68df422;hb=00e09b5e966914ebedb5c08927cf5a66af177171;hpb=0d54c05d27e53e16bc97eb47d63f11fc85e34f74 diff --git a/lib/CPANPLUS/Dist/Gentoo/Maps.pm b/lib/CPANPLUS/Dist/Gentoo/Maps.pm index 5323307..d4a3fe6 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Maps.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Maps.pm @@ -93,44 +93,6 @@ sub version_c2g { return $v; } -=head2 C - -Compares two Gentoo versions. - -=cut - -sub version_gcmp { - my ($a, $b) = map { defined() ? $_ : 0 } @_; - - for ($a, $b) { - s/^[._]+//g; - s/[._]+$//g; - if (/^([\d.]*\d)\.*(?:_p\.*(\d[\d.]*))?\.*(?:-r(\d+))?$/) { - $_ = { - v => [ split /\.+/, $1 ], - p => [ split /\.+/, $2 || 0 ], - r => [ $3 || 0 ], - }; - } else { - require Carp; - Carp::croak("Couldn't parse version string '$_'"); - } - } - - for my $k (qw/v p r/) { - my $xa = $a->{$k}; - my $xb = $b->{$k}; - while (@$xa or @$xb) { - my $na = shift(@$xa) || 0; - my $nb = shift(@$xb) || 0; - my $c = $na <=> $nb; - return $c if $c; - } - } - - return 0; -} - =head1 SEE ALSO L.