[devscripts] 01/01: licensecheck: fix BSD-2-clause detection...

dod at debian.org dod at debian.org
Tue Jun 16 11:29:02 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 23bf8e853b0afc87853289cf3cc4c3eea29f79bc
Author: Dominique Dumont <dod at debian.org>
Date:   Tue Jun 16 13:28:55 2015 +0200

    licensecheck: fix BSD-2-clause detection...
    
    "Redistributions of source code" is part of the first clause of BSD.
    
    The 2nd clause specifies "Redistributions in binary form" not source.
    I've fixed the regexp and updated tests.
---
 scripts/licensecheck.pl            |  2 +-
 test/licensecheck/bsd-1-clause-1.c | 24 ++++++++++++++++++++++++
 test/test_licensecheck             |  1 +
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/scripts/licensecheck.pl b/scripts/licensecheck.pl
index c25fd7a..6eb100f 100755
--- a/scripts/licensecheck.pl
+++ b/scripts/licensecheck.pl
@@ -540,7 +540,7 @@ sub parselicense {
 	    $license = "BSD (4 clause) $license";
 	} elsif ($licensetext =~ /(The name(?:\(s\))? .*? may not|Neither the (names? .*?|authors?) nor the names of( (its|their|other|any))? contributors may) be used to endorse or promote products derived from this software/i) {
 	    $license = "BSD (3 clause) $license";
-	} elsif ($licensetext =~ /Redistributions of source code must retain the above copyright notice/i) {
+	} elsif ($licensetext =~ /Redistributions in binary form must reproduce the above copyright notice/i) {
 	    $license = "BSD (2 clause) $license";
 	} else {
 	    $license = "BSD $license";
diff --git a/test/licensecheck/bsd-1-clause-1.c b/test/licensecheck/bsd-1-clause-1.c
new file mode 100644
index 0000000..8949c28
--- /dev/null
+++ b/test/licensecheck/bsd-1-clause-1.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 1995, 1999
+ *      Berkeley Software Design, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *      BSDI ifaddrs.h,v 2.5 2000/02/23 14:51:59 dab Exp
+ */
diff --git a/test/test_licensecheck b/test/test_licensecheck
index 5e372dd..2928552 100755
--- a/test/test_licensecheck
+++ b/test/test_licensecheck
@@ -52,6 +52,7 @@ testEclipse() {
 }
 
 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)"
 }

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