[libsoftware-license-perl] 06/09: added a method to get text for debian: summary or full text
dod at debian.org
dod at debian.org
Tue Sep 23 11:57:06 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 8fd0cf77eca170738eda56a69ff6d2bf3f6b66a4
Author: Dominique Dumont <dod at debian.org>
Date: Sat Sep 20 11:31:24 2014 +0200
added a method to get text for debian: summary or full text
---
debian/patches/add-debian-text-method | 53 +++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 54 insertions(+)
diff --git a/debian/patches/add-debian-text-method b/debian/patches/add-debian-text-method
new file mode 100644
index 0000000..1469994
--- /dev/null
+++ b/debian/patches/add-debian-text-method
@@ -0,0 +1,53 @@
+--- a/lib/Software/License.pm
++++ b/lib/Software/License.pm
+@@ -82,6 +82,18 @@
+ $self->_fill_in(uc($distro).'-SUMMARY');
+ }
+
++sub debian_text {
++ my ($self,$distro) = @_;
++ $distro ||= 'debian' ;
++
++ my $summary_tag = uc($distro).'-SUMMARY';
++ my $fill_in_tag
++ = $self->section_data($summary_tag) ? $summary_tag
++ : 'LICENSE' ;
++
++ $self->_fill_in($fill_in_tag);
++}
++
+ #pod =method license
+ #pod
+ #pod This method returns the full text of the license.
+--- /dev/null
++++ b/t/debian-text.t
+@@ -0,0 +1,29 @@
++#!perl
++use strict;
++use warnings;
++
++use Test::More tests => 3;
++
++# try LGP2 license
++
++my $class = 'Software::LicenseUtils';
++require_ok($class);
++
++{
++ my $license = $class->new_from_short_name({
++ short_name => 'LGPL-2',
++ holder => 'X. Ample'
++ });
++
++ like($license->debian_text, qr/common-licenses/i, 'summary found');
++
++}
++{
++ my $license = $class->new_from_short_name({
++ short_name => 'Expat',
++ holder => 'X. Ample'
++ });
++
++ like($license->debian_text, qr/substantial/i, 'license text found');
++
++}
diff --git a/debian/patches/series b/debian/patches/series
index eb0a317..7594d39 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,4 +11,5 @@ summary_test
add_or_later_clause
backward-compat
add-expat-short-name
+add-debian-text-method
short-name-fallback
--
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