=head1 VERSION
-Version 0.07
+Version 0.08
=cut
-our $VERSION = '0.07';
+our $VERSION = '0.08';
=head1 DESCRPITON
return $gentooisms{$name} || $name;
}
+=head2 C<license_c2g @licenses>
+
+Maps F<META.yml> C<license> tag values to the corresponding list of Gentoo licenses identifiers.
+Duplicates are stripped off.
+
+The included data was gathered from L<Module::Install> and L<Software::License>.
+
+=cut
+
+my %licenses = (
+ apache => [ 'Apache-2.0' ],
+ artistic => [ 'Artistic' ],
+ artistic_2 => [ 'Artistic-2' ],
+ bsd => [ 'BSD' ],
+ gpl => [ 'GPL-1' ],
+ gpl2 => [ 'GPL-2' ],
+ gpl3 => [ 'GPL-3' ],
+ lgpl => [ 'LGPL-2.1' ],
+ lgpl2 => [ 'LGPL-2.1' ],
+ lgpl3 => [ 'LGPL-3' ],
+ mit => [ 'MIT' ],
+ mozilla => [ 'MPL-1.1' ],
+ perl => [ 'Artistic', 'GPL-2' ],
+);
+
+sub license_c2g {
+ my %seen;
+ grep !$seen{$_}++, map @{$licenses{+lc} || []}, @_;
+}
+
=head2 C<version_c2g $version>
Converts a CPAN version to a Gentoo version.
sub version_c2g {
my ($v) = @_;
+ return unless defined $v;
+
$v =~ y/-/_/;
$v =~ y/0-9._//cd;
return $v;
}
-=head2 C<version_gcmp $va, $vb>
-
-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<CPANPLUS::Dist::Gentoo>.
Crypt-Random crypt-random
DBIx-SearchBuilder dbix-searchbuilder
Data-Buffer data-buffer
+Date-Manip DateManip
Digest digest-base
Digest-BubbleBabble digest-bubblebabble
Digest-MD2 digest-md2
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