[SCM] Debian packaging of libsoftware-license-perl branch, master, updated. 89531df455f5ddcd25a7d92e6aed7ce5fd0270b7

Dominique Dumont dod at debian.org
Tue Oct 4 11:26:44 UTC 2011


The following commit has been merged in the master branch:
commit 1a5210292d717f3e21a316ff87eec9b9953b202f
Author: Dominique Dumont <dod at debian.org>
Date:   Mon Oct 3 15:42:41 2011 +0200

    added a way to create licenses from short names

diff --git a/debian/changelog b/debian/changelog
index b879f94..4c3e939 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-libsoftware-license-perl (0.103002-2) UNRELEASED; urgency=low
+libsoftware-license-perl (0.103002-3) UNRELEASED; urgency=low
 
   [ Ansgar Burchardt ]
   * debian/control: Convert Vcs-* fields to Git.
@@ -7,7 +7,11 @@ libsoftware-license-perl (0.103002-2) UNRELEASED; urgency=low
   * debian/copyright: Replace DEP5 Format-Specification URL from
     svn.debian.org to anonscm.debian.org URL.
 
- -- Ansgar Burchardt <ansgar at debian.org>  Wed, 27 Jul 2011 18:47:45 +0200
+  [ Dominique Dumont ]
+  * added Debian specific methods to get summary
+  * added less specific classes for GPL-1+ and GPL-2+ licenses
+
+ -- Dominique Dumont <dod at debian.org>  Mon, 03 Oct 2011 14:02:01 +0200
 
 libsoftware-license-perl (0.103002-1) unstable; urgency=low
 
diff --git a/debian/patches/create-license-from-short-name b/debian/patches/create-license-from-short-name
new file mode 100644
index 0000000..47e6540
--- /dev/null
+++ b/debian/patches/create-license-from-short-name
@@ -0,0 +1,39 @@
+--- a/lib/Software/License.pm
++++ b/lib/Software/License.pm
+@@ -11,13 +11,35 @@
+ use Sub::Install ();
+ use Text::Template ();
+ 
++my %short_name = (
++  'GPL-1'  => 'GPL_1',
++  'GPL-1+' => 'GPL_1_plus',
++  'GPL-2'  => 'GPL_2',
++  'GPL-2+' => 'GPL_2_plus',
++  'GPL-3'  => 'GPL_3',
++  'GPL-3+' => 'GPL_3_plus',
++  'Artistic' => 'Artistic_1_0',
++  'Artistic-1' => 'Artistic_1_0',
++  'Artistic-2' => 'Artistic_2_0',
++);
+ 
+ sub new {
+   my ($class, $arg) = @_;
+ 
+   Carp::croak "no copyright holder specified" unless $arg->{holder};
+ 
+-  bless $arg => $class;
++  if ($class eq __PACKAGE__ ) {
++    # must create a new license using license short name
++    Carp::croak "no license short name specified" unless $arg->{short_name};
++    my $lic = $short_name{delete $arg->{short_name}} ;
++    Carp::croak "Unknow license short name specified" unless $lic;
++    my $lic_class = __PACKAGE__.'::'.$lic ;
++    eval "require $lic_class;";
++    return $lic_class->new ($arg) ;
++  }
++  else {
++    bless $arg => $class;
++  }
+ }
+ 
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 62b2943..074b5a1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,5 @@ gpl-2-plus-class
 gpl-3-summary
 gpl-3-plus-class
 apache-2-summary
+create-license-from-short-name
+test-short-name
diff --git a/debian/patches/test-short-name b/debian/patches/test-short-name
new file mode 100644
index 0000000..2e86c36
--- /dev/null
+++ b/debian/patches/test-short-name
@@ -0,0 +1,19 @@
+--- /dev/null
++++ b/t/short_name.t
+@@ -0,0 +1,16 @@
++#!perl
++use strict;
++use warnings;
++
++use Test::More tests => 6;
++
++my $class = 'Software::License';
++require_ok($class);
++
++my $license = $class->new({ short_name => 'GPL-1+', holder => 'X. Ample' });
++
++is($license->holder, 'X. Ample', '(c) holder');
++is($license->year, (localtime)[5]+1900, '(c) year');
++isa_ok($license,'Software::License::GPL_1_plus',"license class");
++like($license->name, qr/version 1 or later/i, "license name");
++like($license->fulltext, qr/general public/i, 'license text');

-- 
Debian packaging of libsoftware-license-perl



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