[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.462,1.463
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <kwi...@us...> - 2005-07-25 03:52:28
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8226/lib/Module/Build Modified Files: Base.pm Log Message: Add the license_url field if present Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.462 retrieving revision 1.463 diff -u -d -r1.462 -r1.463 --- Base.pm 21 Jul 2005 00:52:46 -0000 1.462 +++ Base.pm 25 Jul 2005 03:52:10 -0000 1.463 @@ -2444,8 +2444,26 @@ } BEGIN { *scripts = \&script_files; } -sub valid_licenses { - return { map {$_, 1} qw(perl gpl artistic lgpl bsd mit mozilla apache open_source unrestricted restrictive unknown) }; +{ + my %licenses = + ( + perl => 'http://search.cpan.org/src/NWCLARK/perl-5.8.7/README', + gpl => 'http://www.opensource.org/licenses/gpl-license.php', + apache => 'http://apache.org/licenses/LICENSE-2.0', + artistic => 'http://opensource.org/licenses/artistic-license.php', + lgpl => 'http://opensource.org/licenses/artistic-license.php', + bsd => 'http://www.opensource.org/licenses/bsd-license.php', + gpl => 'http://www.opensource.org/licenses/gpl-license.php', + mit => 'http://opensource.org/licenses/mit-license.php', + mozilla => 'http://opensource.org/licenses/mozilla1.1.php', + open_source => undef, + unrestricted => undef, + restrictive => undef, + unknown => undef, + ); + sub valid_licenses { + return \%licenses; + } } sub meta_add { @@ -2572,6 +2590,9 @@ (my $name = $_) =~ s/^dist_//; $node->{$name} = $self->$_(); } + if (defined( my $url = $self->valid_licenses->{ $self->license } )) { + $node->{license_url} = $url; + } foreach ( @{$self->prereq_action_types} ) { $node->{$_} = $p->{$_} if exists $p->{$_} and keys %{ $p->{$_} }; |