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=3365a0f7c38222e845d092019176b09163cfb2ce;hp=884b24fa2d8bc1324be775da6b62324949a09dab;hb=1c081d8b9a6c65ece91fa1363a4bdd9e49b00a37;hpb=7278013a1296d32f2f2b4dc61d4463dc1ba30812 diff --git a/lib/CPANPLUS/Dist/Gentoo/Maps.pm b/lib/CPANPLUS/Dist/Gentoo/Maps.pm index 884b24f..3365a0f 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Maps.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Maps.pm @@ -79,6 +79,8 @@ Converts a CPAN version to a Gentoo version. sub version_c2g { my ($v) = @_; + return unless defined $v; + $v =~ y/-/_/; $v =~ y/0-9._//cd; @@ -93,44 +95,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. @@ -212,6 +176,7 @@ Locale-Maketext-Lexicon locale-maketext-lexicon Log-Dispatch log-dispatch Math-Pari math-pari Module-Info module-info +NTLM Authen-NTLM Net-Ping net-ping Net-SFTP net-sftp Net-SSH-Perl net-ssh-perl