[licensecheck] 18/26: Add license patterns mit_cmu mit_cmu_warranty to Regexp::Pattern::License::Pattern.

Jonas Smedegaard dr at jones.dk
Sun Feb 5 10:12:07 UTC 2017


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

js pushed a commit to branch master
in repository licensecheck.

commit 1b50dcf7a19ddb55a5fd4ac78a2100dc87100f0c
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Tue Jan 24 03:39:32 2017 +0100

    Add license patterns mit_cmu mit_cmu_warranty to Regexp::Pattern::License::Pattern.
---
 lib/App/Licensecheck.pm             |  3 ++-
 lib/Regexp/Pattern/License.pm       | 32 ++++++++++++++++++++++++++++++++
 lib/Regexp/Pattern/License/Parts.pm | 33 +++++++++++++++++++++++++++++----
 t/SPDX/MIT-CMU.txt                  |  9 +++++++++
 t/fedora.t                          |  2 +-
 5 files changed, 73 insertions(+), 6 deletions(-)

diff --git a/lib/App/Licensecheck.pm b/lib/App/Licensecheck.pm
index 109361f..bf530f6 100755
--- a/lib/App/Licensecheck.pm
+++ b/lib/App/Licensecheck.pm
@@ -811,7 +811,8 @@ sub parse_license
 			qw(
 			adobe_2006 adobe_glyph aladdin apafml
 			beerware cube curl eurosym fsfap ftl icu isc libpng llgpl
-			mit_advertising mit_enna mit_feh mit_new mit_old
+			mit_advertising mit_cmu mit_cmu_warranty
+			mit_enna mit_feh mit_new mit_old
 			mit_oldstyle mit_oldstyle_disclaimer mit_oldstyle_permission
 			ms_pl ms_rl postgresql unicode_strict unicode_tou
 			zlib zlib_acknowledgement)
diff --git a/lib/Regexp/Pattern/License.pm b/lib/Regexp/Pattern/License.pm
index c6d9b26..c1496f0 100644
--- a/lib/Regexp/Pattern/License.pm
+++ b/lib/Regexp/Pattern/License.pm
@@ -480,6 +480,38 @@ our %RE = (
 		tags    => ['mit'],
 		pat => qr/$P{note_marketing}\b[^.,]+, and $P{ack_doc_mat_pkg_use}/,
 	},
+	mit_cmu => {
+		name        => 'MIT-CMU',
+		description => <<'END',
+Identical to NTP, except...
+ * omit explicit permission for charging fee
+ * exclude suitability disclaimer
+ * exclude terse "as is" warranty disclaimer
+ * include elaborate warranty disclaimer
+ * include liability disclaimer
+
+fingerprint: "without specific written permission"
+
+SPDX and fedora sample seem not generic but the unique file COPYING from project net-snmp.
+END
+		tags => ['mit'],
+		pat =>
+			qr/Permission $P{to_dist} $P{sw_doc} $P{any_purpose} and $P{nofee} $P{granted}, $P{retain_copr_appear} and that $P{repro_copr_perm_appear_doc}, and that $P{nopromo_name_written}\./,
+	},
+	mit_cmu_warranty => {
+		'name.alt.org.debian'    => 'MIT-CMU~warranty',
+		caption                  => 'MIT (CMU, retain warranty disclaimer)',
+		'caption.alt.org.fedora' => 'MIT (MLton / Standard ML of New Jersey)',
+		description              => <<'END',
+Identical to MIT-CMU, except...
+ * add requirement of "warranty disclaimer" appearing in documentation
+
+fingerprint: "warranty disclaimer appear"
+END
+		tags => ['mit'],
+		pat =>
+			qr/Permission $P{to_dist} $P{sw_doc} $P{any_purpose} and $P{nofee} $P{granted}, $P{retain_copr_appear} and that $P{repro_copr_perm_warr_appear_doc}, and that $P{nopromo_name_written_prior}\./,
+	},
 	mit_enna => {
 		name    => 'MIT-enna',
 		caption => 'MIT (enna)',
diff --git a/lib/Regexp/Pattern/License/Parts.pm b/lib/Regexp/Pattern/License/Parts.pm
index 102d3da..d052aac 100644
--- a/lib/Regexp/Pattern/License/Parts.pm
+++ b/lib/Regexp/Pattern/License/Parts.pm
@@ -50,19 +50,23 @@ our %RE = (
 		{ pat => qr/all copies of the Software and its Copyright notices/ },
 	cp_sw_doc =>
 		{ pat => qr/all copies of the Software and its documentation/ },
+	sw_doc => { pat => qr/this software and its documentation/ },
 	the_sw => {
 		pat =>
 			qr/this software and associated documentation files \(the "?Software"?\)/
 	},
 
 	# rights
-	perm_granted => { pat => qr/Permission is hereby granted/ },
+	perm        => { pat => qr/Permission/ },
+	any_purpose => { pat => qr/for any purpose/ },
 	to_deal_mat =>
 		{ pat => qr/to deal in the Materials without restriction/ },
+	granted               => { pat => qr/is hereby granted/ },
 	to_deal_the_sw_rights => {
 		pat =>
 			qr/to deal in the Software without restriction, including without limitation the rights/
 	},
+	to_dist       => { pat => qr/to use, copy, modify,? and distribute/ },
 	to_mod_sublic => {
 		pat =>
 			qr/to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of/
@@ -82,6 +86,7 @@ our %RE = (
 		pat =>
 			qr/without written agreement and without license or royalty fees/
 	},
+	nofee => { pat => qr/without fee/ },
 
 	# conditions
 	subj_cond           => { pat => qr/subject to the following conditions/ },
@@ -110,6 +115,7 @@ our %RE = (
 			qr/If you change this software and redistribute parts or all of it in any form, you must make the source code of the altered version of this software available/
 	},
 	incl => { pat => qr/shall be included/ },
+	name => { pat => qr/[Tt]he names?(?: \S+){1,15}/ },
 	namenot =>
 		{ pat => qr/[Tt]he names?(?: \S+){1,15} (?:may|must|shall) not/ },
 	neithername => {
@@ -140,9 +146,14 @@ our %RE = (
 		pat =>
 			qr/be used to endorse or promote products derived from this software/
 	},
-	used_ad => { pat => qr/be used in advertising/ },
+	used_ad      => { pat => qr/be used in advertising/ },
+	used_ad_dist => {
+		pat =>
+			qr/be used in (?:any )?advertising or publicity pertaining to distribution of the software/
+	},
 	without_prior_written =>
 		{ pat => qr/without specific prior written permission/ },
+	without_written => { pat => qr/without specific written permission/ },
 	without_written_prior =>
 		{ pat => qr/without specific, written prior permission/ },
 	origin_sw_no_misrepresent => {
@@ -204,9 +215,14 @@ our %RE = (
 		pat =>
 			qr/the following acknowledge?ment\W+This product includes software developed by/
 	},
+	copr      => { pat => qr/[Tt]he above copyright notice/ },
 	copr_perm => {
 		pat =>
-			qr/[Tt]he above copyright notice(?:\(?s\)?)? and this permission notice/
+			qr/(?:both t|t|T)(?:hat|he|he above) copyright notice(?:s|\(s\))? and this permission notice/
+	},
+	copr_perm_warr => {
+		pat =>
+			qr/(?:both t|t|T)(?:hat|he|he above) copyright notice(?:s|\(s\))? and this permission notice and warranty disclaimer/
 	},
 	copr_cond_discl => {
 		pat =>
@@ -220,12 +236,17 @@ our %RE = (
 		{ pat => qr/and without a written agreement/ },
 );
 
+$RE{perm_granted}{pat} = qr/$RE{perm}{pat} $RE{granted}{pat}/;
 $RE{ad_mat_ack_this}{pat}
 	= qr/All advertising materials mentioning features or use of this software must display $RE{ack_name}{pat}/;
 $RE{note_copr_perm}{pat}
 	= qr/provided that$I? $RE{copr_perm}{pat} appear in all copies/;
+$RE{repro_copr_perm_warr_appear_doc}{pat}
+	= qr/$RE{copr_perm_warr}{pat} appear in supporting documentation/;
 $RE{note_marketing}{pat}
 	= qr/$RE{incl}{pat} in $RE{cp_sw}{pat}, its documentation and marketing/;
+$RE{retain_copr_appear}{pat}
+	= qr/provided that $RE{copr}{pat} appears? in all copies/;
 $RE{retain_copr_perm_subst}{pat}
 	= qr/$RE{copr_perm}{pat} $RE{incl}{pat} in all copies or substantial portions of the Software/;
 $RE{retain_copr_perm_sw_copr}{pat}
@@ -236,10 +257,14 @@ $RE{retain_notice_cond_discl}{pat}
 	= qr/Redistributions of source code must retain $RE{copr_cond_discl}{pat}/;
 $RE{nopromo_except}{pat}
 	= qr/Except as contained in this notice, $RE{namenot}{pat} $RE{used_ad}{pat}/;
+$RE{nopromo_name_written}{pat}
+	= qr/$RE{name}{pat} not $RE{used_ad_dist}{pat} $RE{without_written}{pat}/;
+$RE{nopromo_name_written_prior}{pat}
+	= qr/$RE{name}{pat} not $RE{used_ad_dist}{pat} $RE{without_written_prior}{pat}/;
 $RE{repro_copr_cond_discl}{pat}
 	= qr/$RE{redist_bin_repro}{pat} $RE{copr_cond_discl}{pat} in $RE{doc_mat_dist}{pat}/;
 $RE{repro_copr_perm_appear_doc}{pat}
-	= qr/both $RE{copr_perm}{pat} appear in supporting documentation/;
+	= qr/$RE{copr_perm}{pat} appear in supporting documentation/;
 $RE{nopromo_neither}{pat}
 	= qr/(?:$RE{neithername}{pat}|$RE{namenot}{pat}) $RE{used_endorse_deriv}{pat} $RE{without_prior_written}{pat}/;
 $RE{redist_ack_this}{pat}
diff --git a/t/SPDX/MIT-CMU.txt b/t/SPDX/MIT-CMU.txt
new file mode 100644
index 0000000..c32911e
--- /dev/null
+++ b/t/SPDX/MIT-CMU.txt
@@ -0,0 +1,9 @@
+Copyright 1989, 1991, 1992 by Carnegie Mellon University
+
+Derivative Work - 1996, 1998-2000 Copyright 1996, 1998-2000 The Regents of the University of California
+
+All Rights Reserved
+
+Permission to use, copy, modify and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of CMU and The Regents of the University of California not be used in advertising or publicity pertaining to distribution of the software without specific written permission.
+
+CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL CMU OR THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE  [...]
\ No newline at end of file
diff --git a/t/fedora.t b/t/fedora.t
index b1d3b52..48ad99e 100644
--- a/t/fedora.t
+++ b/t/fedora.t
@@ -27,7 +27,7 @@ test "Parse corpus" => sub {
 
 run_me(
 	{   license =>
-			'Adobe-Glyph and/or BSL and/or DSDP and/or Expat and/or ICU and/or MIT-enna and/or MIT-feh and/or MIT~old and/or MIT~oldstyle and/or MIT~oldstyle~disclaimer and/or PostgreSQL',
+			'Adobe-Glyph and/or BSL and/or DSDP and/or Expat and/or ICU and/or MIT-CMU and/or MIT-CMU~warranty and/or MIT-enna and/or MIT-feh and/or MIT~old and/or MIT~oldstyle and/or MIT~oldstyle~disclaimer and/or PostgreSQL',
 		corpus => 'MIT'
 	}
 );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/licensecheck.git



More information about the Pkg-perl-cvs-commits mailing list