[libsoftware-license-perl] 01/02: short_name patch: also find license for short names with version, e.g. Apache-2.0

dod at debian.org dod at debian.org
Sat Sep 27 16:10:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libsoftware-license-perl.

commit fe9f3fc191180e4db840ef827a01ee1f69992ebe
Author: Dominique Dumont <dod at debian.org>
Date:   Sat Sep 27 18:07:17 2014 +0200

    short_name patch: also find license for short names with version, e.g. Apache-2.0
---
 debian/patches/short-name-fallback | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/debian/patches/short-name-fallback b/debian/patches/short-name-fallback
index 78c97a8..2c5a9eb 100644
--- a/debian/patches/short-name-fallback
+++ b/debian/patches/short-name-fallback
@@ -4,15 +4,18 @@ Forwarded: https://github.com/rjbs/Software-License/pull/31
 Author: dod
 --- a/lib/Software/LicenseUtils.pm
 +++ b/lib/Software/LicenseUtils.pm
-@@ -212,14 +212,13 @@
+@@ -211,15 +211,15 @@
+ 
    Carp::croak "no license short name specified"
      unless defined $arg->{short_name};
-   my $short = delete $arg->{short_name};
+-  my $short = delete $arg->{short_name};
 -  Carp::croak "Unknow license with short name $short"
 -    unless $short_name{$short};
++  my $subclass = my $short = delete $arg->{short_name};
++  $subclass =~ s/[\-.]/_/g;
  
 -  my $info = $short_name{$short} ;
-+  my $info = $short_name{$short} || "Software::License::$short";
++  my $info = $short_name{$short} || "Software::License::$subclass";
    my @infos = ref $info ? @$info : ($info);
    my $lic_file = my $lic_class = shift @infos;
    $lic_file =~ s!::!/!g;
@@ -22,7 +25,7 @@ Author: dod
    return $lic_class->new( { %$arg, @infos } );
  }
  
-@@ -276,7 +275,10 @@
+@@ -276,7 +276,10 @@
  
  Create a new L<Software::License> object from the license specified
  with C<short_name>. Known short license names are C<GPL-*>, C<LGPL-*> ,
@@ -41,11 +44,11 @@ Author: dod
  use warnings;
  
 -use Test::More tests => 6;
-+use Test::More tests => 7;
++use Test::More tests => 8;
  
  my $class = 'Software::LicenseUtils';
  require_ok($class);
-@@ -17,3 +17,10 @@
+@@ -17,3 +17,16 @@
  isa_ok($license,'Software::License::GPL_1',"license class");
  like($license->name, qr/version 1/i, "license name");
  like($license->fulltext, qr/general public/i, 'license text');
@@ -56,3 +59,9 @@ Author: dod
 +    holder => 'X. Ample'
 +});
 +isa_ok($mit_lic,'Software::License::MIT',"license class");
++
++my $apache_lic = $class->new_from_short_name({
++    short_name => 'Apache-2.0',
++    holder => 'X. Ample'
++});
++isa_ok($apache_lic,'Software::License::Apache_2_0',"license class");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libsoftware-license-perl.git



More information about the Pkg-perl-cvs-commits mailing list