[devscripts] 03/04: Parse "license: BSD-x-Clause" declaration (Closes: #820798)

dod at debian.org dod at debian.org
Sun May 22 13:16:30 UTC 2016


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

dod pushed a commit to branch master
in repository devscripts.

commit 098ffabef2a8fd6e81d2ea716670032f9219efdd
Author: Dominique Dumont <dod at debian.org>
Date:   Sun May 22 15:12:33 2016 +0200

    Parse "license: BSD-x-Clause" declaration (Closes: #820798)
---
 scripts/licensecheck.pl        | 10 ++++++++++
 test/licensecheck/mame-style.c |  6 ++++++
 test/test_licensecheck         |  2 ++
 3 files changed, 18 insertions(+)

diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index 20a852c..74eba93 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -777,6 +777,16 @@ sub parselicense {
 	    push @spdx_license, 'BSD';
 	}
     }
+    elsif ($licensetext =~ /licen[sc]ebsd(?:-(\d)-clause)?/i) {
+	if ($1) {
+	    $license = "BSD ($1 clause) $license";
+	    push @spdx_license, "BSD-$1-Clause";
+	 }
+	else {
+	    $license = "BSD $license";
+	    push @spdx_license, "BSD";
+	}
+    }
 
     if ($licensetext =~ /Mozilla Public License,? (?:(?:Version|v\.)\s+)?(\d+(?:\.\d+)?)/) {
 	$license = "MPL (v$1) $license";
diff --git a/test/licensecheck/mame-style.c b/test/licensecheck/mame-style.c
new file mode 100644
index 0000000..f005dc7
--- /dev/null
+++ b/test/licensecheck/mame-style.c
@@ -0,0 +1,6 @@
+// header found in mame project See #820798
+
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+
+// yada yada yada
diff --git a/test/test_licensecheck b/test/test_licensecheck
index db8ffcf..f6200b8 100755
--- a/test/test_licensecheck
+++ b/test/test_licensecheck
@@ -63,6 +63,8 @@ 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)"
+    license2 "-m --copyright" "mame-style.c" "BSD (3 clause)	Miodrag Milanovic"
+    license2 "-m --copyright --deb-fmt" "mame-style.c" "BSD-3-Clause	Miodrag Milanovic"
 }
 
 testMultiLineDeclaration() {

-- 
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