Commit 0b90ecca authored by Dominique Dumont's avatar Dominique Dumont

refreshed add_or_later_clause patch

parent c57307bd
......@@ -16,26 +16,35 @@ Description: add or_later license parameter
}
--- a/lib/Software/LicenseUtils.pm
+++ b/lib/Software/LicenseUtils.pm
@@ -123,12 +123,19 @@
@@ -137,6 +137,13 @@
'Artistic' => 'Software::License::Artistic_1_0',
'Artistic-1' => 'Software::License::Artistic_1_0',
'Artistic-2' => 'Software::License::Artistic_2_0',
+ 'GPL-1+' => [ 'Software::License::GPL_1', or_later => 1 ],
+ 'GPL-2+' => [ 'Software::License::GPL_2', or_later => 1 ],
+ 'GPL-3+' => [ 'Software::License::GPL_3', or_later => 1 ],
+ 'LGPL-2+' => [ 'Software::License::LGPL_2', or_later => 1 ],
+ 'LGPL-2.1+' => [ 'Software::License::LGPL_2_1', or_later => 1 ],
+ 'LGPL-3+' => [ 'Software::License::LGPL_3_0', or_later => 1 ],
+ 'LGPL-3.0+' => [ 'Software::License::LGPL_3_0', or_later => 1 ],
);
my %short_name = (
'GPL-1' => [ 'GPL_1' ],
+ 'GPL-1+' => [ 'GPL_1', or_later => 1 ],
'GPL-2' => [ 'GPL_2' ],
+ 'GPL-2+' => [ 'GPL_2', or_later => 1 ],
'GPL-3' => [ 'GPL_3' ],
+ 'GPL-3+' => [ 'GPL_3', or_later => 1 ],
'LGPL-2' => [ 'LGPL_2' ],
+ 'LGPL-2+' => [ 'LGPL_2', or_later => 1 ],
'LGPL-2.1' => [ 'LGPL_2_1' ],
+ 'LGPL-2.1+' => [ 'LGPL_2_1', or_later => 1 ],
'LGPL-3' => [ 'LGPL_3_0' ],
'LGPL-3.0' => [ 'LGPL_3_0' ],
+ 'LGPL-3+' => [ 'LGPL_3_0', or_later => 1 ],
+ 'LGPL-3.0+' => [ 'LGPL_3_0', or_later => 1 ],
'Artistic' => [ 'Artistic_1_0' ],
'Artistic-1' => [ 'Artistic_1_0' ],
'Artistic-2' => [ 'Artistic_2_0' ],
@@ -149,10 +156,12 @@
Carp::croak "Unknow license with short name $short"
unless $short_name{$short};
- my $lic_file = my $lic_class = $short_name{$short} ;
+ my $info = $short_name{$short} ;
+ my @infos = ref $info ? @$info : ($info);
+ my $lic_file = my $lic_class = shift @infos;
$lic_file =~ s!::!/!g;
require "$lic_file.pm";
- return $lic_class->new( $arg );
+ return $lic_class->new( { %$arg, @infos } );
}
1;
--- a/t/summary.t
+++ b/t/summary.t
@@ -2,7 +2,7 @@
......
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