Commit 30c0ffb7 authored by Dominique Dumont's avatar Dominique Dumont

improved patch

parent d52ca0c7
--- a/lib/Software/LicenseUtils.pm --- a/lib/Software/LicenseUtils.pm
+++ b/lib/Software/LicenseUtils.pm +++ b/lib/Software/LicenseUtils.pm
@@ -214,7 +214,7 @@ @@ -211,14 +211,13 @@
Carp::croak "Unknow license with short name $short" Carp::croak "no license short name specified"
unless $short_name{$short}; unless defined $arg->{short_name};
my $short = delete $arg->{short_name};
- Carp::croak "Unknow license with short name $short"
- unless $short_name{$short};
- my $info = $short_name{$short} ; - my $info = $short_name{$short} ;
+ my $info = $short_name{$short} || "Software::License::$short"; + my $info = $short_name{$short} || "Software::License::$short";
my @infos = ref $info ? @$info : ($info); my @infos = ref $info ? @$info : ($info);
my $lic_file = my $lic_class = shift @infos; my $lic_file = my $lic_class = shift @infos;
$lic_file =~ s!::!/!g; $lic_file =~ s!::!/!g;
- require "$lic_file.pm";
+ eval { require "$lic_file.pm"; } ;
+ Carp::croak "Unknow license with short name $short ($@)" if $@;
return $lic_class->new( { %$arg, @infos } );
}
@@ -288,4 +287,4 @@
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
-=cut
+=CUT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment