X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=7aa5da9e8dc08819af955348a6c0942a06657cab;hb=b3ea084ff7dcd01c3aa4440b4148c8c4ed14b944;hp=84ed79215182f13d0c044fdfce7b80f8cd6cfee0;hpb=7e2aca98057c17b7728aa3028a07dacd2fdd0d62;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 84ed792..7aa5da9 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -9,7 +9,6 @@ use File::Path qw/mkpath/; use File::Spec::Functions qw/catdir catfile/; use IPC::Cmd qw/run can_run/; -use version; use CPANPLUS::Error; @@ -23,11 +22,11 @@ CPANPLUS::Dist::Gentoo - CPANPLUS backend generating Gentoo ebuilds. =head1 VERSION -Version 0.05 +Version 0.06 =cut -our $VERSION = '0.05'; +our $VERSION = '0.06'; =head1 SYNOPSIS @@ -207,16 +206,7 @@ sub prepare { $stat->distribution($name . '-' . $version); - $version =~ s/[^\d._]+//g; - $version =~ s/^[._]*//; - $version =~ s/[._]*$//; - $version =~ s/[._]*_[._]*/_/g; - { - ($version, my $patch, my @rest) = split /_/, $version; - $version .= '_p' . $patch if defined $patch; - $version .= join('.', '', @rest) if @rest; - } - $stat->eb_version($version); + $stat->eb_version(CPANPLUS::Dist::Gentoo::Maps::version_c2g($version)); $stat->eb_name(CPANPLUS::Dist::Gentoo::Maps::name_c2g($name)); @@ -379,7 +369,7 @@ sub _cpan2portage { $name = CPANPLUS::Dist::Gentoo::Maps::name_c2g($name); my $ver; - $ver = eval { version->new($version) } if defined $version; + $ver = CPANPLUS::Dist::Gentoo::Maps::version_c2g($version) if defined $version; my @portdirs = ($main_portdir, @{$self->status->portdir_overlay}); @@ -392,10 +382,10 @@ sub _cpan2portage { if (defined $ver) { # implies that $version is defined for (@ebuilds) { - next unless /\Q$atom\E-v?([\d._]+).*?\.ebuild$/; - my $eb_ver = eval { version->new($1) }; - next unless defined $eb_ver and $eb_ver >= $ver; - return ">=$category/$atom-$version"; + my ($eb_ver) = /\Q$atom\E-v?([\d._pr-]+).*?\.ebuild$/; + return ">=$category/$atom-$ver" + if defined $eb_ver + and CPANPLUS::Dist::Gentoo::Maps::version_gcmp($eb_ver, $ver) > 0; } } else { return "$category/$atom"; @@ -465,9 +455,9 @@ sub _run { Gentoo (L). -L, L (core modules since 5.9.5), L (since 5.009). +L, L (core modules since 5.9.5). -L (since perl 5) L (5.001), L (5.002), L (5.00504). +L, L (since perl 5), L (5.001), L (5.002), L (5.00504). =head1 SEE ALSO