[devscripts] 05/16: license_check: improve GPL LGPL extraction
dod at debian.org
dod at debian.org
Thu May 14 16:34:25 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 8b9f854165a6aafefc2c68200fc6892559b155bf
Author: Dominique Dumont <dod at debian.org>
Date: Thu May 14 16:13:36 2015 +0200
license_check: improve GPL LGPL extraction
---
scripts/licensecheck.pl | 5 +++--
test/licensecheck/gpl-no-version.h | 8 ++++++++
test/licensecheck/lgpl-no-version.h | 8 ++++++++
test/test_licensecheck | 2 ++
4 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index b7b24e7..d6c33b5 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -498,8 +498,9 @@ sub parselicense {
$license = "GPL$gplver$extrainfo $license";
}
- if ($licensetext =~ /is distributed.*terms.*GPL/) {
- $license = "GPL (unversioned/unknown version) $license";
+ if ($licensetext =~ /is\s(?:distributed.*?terms|being\s+released).*?\b(L?GPL)\b/) {
+ my $v = $gplver || ' (unversioned/unknown version)';
+ $license = "$1$v $license";
}
if ($licensetext =~ /This file is part of the .*Qt GUI Toolkit. This file may be distributed under the terms of the Q Public License as defined/) {
diff --git a/test/licensecheck/gpl-no-version.h b/test/licensecheck/gpl-no-version.h
new file mode 100644
index 0000000..c03fd31
--- /dev/null
+++ b/test/licensecheck/gpl-no-version.h
@@ -0,0 +1,8 @@
+/*-
+ * Copyright (c) 2011 Wolfgang Hauck <wolfgang.hauck at gmx.de>.
+ * Derived from imon-module.
+ *
+ * This source code is being released under the GPL.
+ * Please see the file COPYING in this package for details.
+ */
+
diff --git a/test/licensecheck/lgpl-no-version.h b/test/licensecheck/lgpl-no-version.h
new file mode 100644
index 0000000..8f778fd
--- /dev/null
+++ b/test/licensecheck/lgpl-no-version.h
@@ -0,0 +1,8 @@
+/*-
+ * Copyright (c) 2011 Wolfgang Hauck <wolfgang.hauck at gmx.de>.
+ * Derived from imon-module.
+ *
+ * This source code is being released under the LGPL.
+ * Please see the file COPYING in this package for details.
+ */
+
diff --git a/test/test_licensecheck b/test/test_licensecheck
index 568d52a..f16b0df 100755
--- a/test/test_licensecheck
+++ b/test/test_licensecheck
@@ -51,6 +51,7 @@ testLGPL() {
license "lgpl-2-3.c" "LGPL (v2 or v3)"
license "lgpl-3+.h" "LGPL (v3 or later)"
license "lgpl-variation.c" "LGPL (v3 or later)"
+ license "lgpl-no-version.h" "LGPL (unversioned/unknown version)"
}
testGPL() {
@@ -65,6 +66,7 @@ testGPL() {
license "gpl-3-only.c" "GPL (v3)"
license "gpl-variation.c" "GPL (v3 or later)"
license "gpl-3+.el" "GPL (v3 or later)"
+ license "gpl-no-version.h" "GPL (unversioned/unknown version)"
}
testDual() {
--
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