[devscripts] 01/01: licensecheck: extract © owner when © and owners are specified on more than 2 lines.
dod at debian.org
dod at debian.org
Tue Jul 21 11:51:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
dod pushed a commit to branch master
in repository devscripts.
commit e6d1dff05beaeed1fa1b841837fb9092155bdb66
Author: Dominique Dumont <dod at debian.org>
Date: Tue Jul 21 13:51:25 2015 +0200
licensecheck: extract © owner when © and owners are specified on more than 2 lines.
Also added a test file for this rather special case
---
debian/changelog | 2 +-
scripts/licensecheck.pl | 4 ++--
test/licensecheck/texinfo.tex | 27 +++++++++++++++++++++++++++
test/test_licensecheck | 6 ++++++
4 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 1cb2332..c63bd59 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,7 +12,7 @@ devscripts (2.15.6) UNRELEASED; urgency=medium
[ Dominique Dumont ]
* licensecheck:
- * extract © owner when © and owners are specified on 2 lines.
+ * extract © owner when © and owners are specified on 2 or more lines.
* fix digia © and license extraction (Closes: #789074)
* fix BSD-2-clause detection
* parse assembly files with suffix .S
diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 2a86e9e..bac3353 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -374,8 +374,8 @@ sub extract_copyright {
my $line = shift @c ;
my $copyright_match = parse_copyright($line) ;
if ($copyright_match) {
- if ($copyright_match =~ /\d[,.]?\s*$/) {
- # looks like copyright end with a year, assume the owner is on next line
+ while ($copyright_match =~ /\d[,.]?\s*$/) {
+ # looks like copyright end with a year, assume the owner is on next line(s)
$copyright_match .= ' '. shift @c;
}
$copyright_match =~ s/\s+/ /g;
diff --git a/test/licensecheck/texinfo.tex b/test/licensecheck/texinfo.tex
new file mode 100644
index 0000000..df05856
--- /dev/null
+++ b/test/licensecheck/texinfo.tex
@@ -0,0 +1,27 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2012-03-11.15}
+%
+% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation, either version 3 of the
+% License, or (at your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. (This has been our intent since Texinfo was invented.)
diff --git a/test/test_licensecheck b/test/test_licensecheck
index bc0d8d7..0b22d57 100755
--- a/test/test_licensecheck
+++ b/test/test_licensecheck
@@ -55,7 +55,13 @@ testBSD() {
license "bsd-1-clause-1.c" "BSD"
license "bsd-3-clause.cpp" "BSD (3 clause)"
license "bsd-3-clause-authorsany.c" "BSD (3 clause)"
+}
+
+testMultiLineDeclaration() {
+ # test copyright declared on 2 lines
license2 "-m --copyright" "bsd-regents.c" "BSD (3 clause) 1987, 1993, 1994 The Regents of the University of California. All rights reserved."
+ # or 3 lines
+ license2 "-m --copyright" "texinfo.tex" "GPL (v3 or later) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc."
}
testLGPL() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list