Skip to content

Commit 45bbafd

Browse files
authored
Merge pull request #1384 from nexB/new-and-improved-license-rules-02-18
Add new and improved licenses, rules and tests
2 parents c38889d + 9ab892d commit 45bbafd

File tree

5,569 files changed

+517243
-1488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,569 files changed

+517243
-1488
lines changed

.travis.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ env:
1414
- TEST_SUITE="$PYTEST --ignore=tests/scancode --ignore=tests/extractcode --ignore=tests/licensedcode --ignore=tests/cluecode --ignore=tests/packagedcode"
1515
- TEST_SUITE="$PYTEST tests/scancode"
1616
- TEST_SUITE="$PYTEST tests/extractcode"
17-
- TEST_SUITE="$PYTEST tests/licensedcode --ignore=tests/licensedcode/test_zzzz_cache.py"
17+
- TEST_SUITE="$PYTEST tests/licensedcode --ignore=tests/licensedcode/test_zzzz_cache.py --ignore=tests/licensedcode/test_detection_datadriven_more.py --ignore=tests/licensedcode/test_detection_datadriven.py"
18+
- TEST_SUITE="$PYTEST tests/licensedcode/test_detection_datadriven.py"
19+
- TEST_SUITE="$PYTEST tests/licensedcode/test_detection_datadriven_more.py"
1820
- TEST_SUITE="$PYTEST tests/licensedcode/test_zzzz_cache.py"
1921
- TEST_SUITE="$PYTEST tests/cluecode"
2022
- TEST_SUITE="$PYTEST tests/packagedcode"
@@ -58,7 +60,22 @@ matrix:
5860
python:
5961
osx_image: xcode7.3
6062
- os: osx
61-
env: TEST_SUITE="$PYTEST tests/licensedcode"
63+
env: TEST_SUITE="$PYTEST tests/licensedcode --ignore=tests/licensedcode/test_zzzz_cache.py --ignore=tests/licensedcode/test_detection_datadriven_more.py --ignore=tests/licensedcode/test_detection_datadriven.py"
64+
language: generic
65+
python:
66+
osx_image: xcode7.3
67+
- os: osx
68+
env: TEST_SUITE="$PYTEST tests/licensedcode/test_detection_datadriven.py"
69+
language: generic
70+
python:
71+
osx_image: xcode7.3
72+
- os: osx
73+
env: TEST_SUITE="$PYTEST tests/licensedcode/test_detection_datadriven_more.py""
74+
language: generic
75+
python:
76+
osx_image: xcode7.3
77+
- os: osx
78+
env: TEST_SUITE="$PYTEST tests/licensedcode/test_zzzz_cache.py"
6279
language: generic
6380
python:
6481
osx_image: xcode7.3

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ environment:
55
- TEST_SUITE: "py.test -n 2 -vvs --ignore=tests/scancode --ignore=tests/extractcode --ignore=tests/licensedcode --ignore=tests/cluecode --ignore=tests/packagedcode"
66
- TEST_SUITE: "py.test -n 2 -vvs tests/scancode"
77
- TEST_SUITE: "py.test -n 2 -vvs tests/extractcode"
8-
- TEST_SUITE: "py.test -n 2 -vvs tests/licensedcode --ignore=tests/licensedcode/test_zzzz_cache.py"
8+
- TEST_SUITE: "py.test -n 2 -vvs tests/licensedcode --ignore=tests/licensedcode/test_zzzz_cache.py --ignore=tests/licensedcode/test_detection_datadriven_more.py --ignore=tests/licensedcode/test_detection_datadriven.py"
9+
- TEST_SUITE: "py.test -n 2 -vvs tests/licensedcode/test_detection_datadriven.py"
10+
- TEST_SUITE: "py.test -n 2 -vvs tests/licensedcode/test_detection_datadriven_more.py"
911
- TEST_SUITE: "py.test -vvs tests/licensedcode/test_zzzz_cache.py"
1012
- TEST_SUITE: "py.test -n 2 -s tests/cluecode"
1113
- TEST_SUITE: "py.test -n 2 -s tests/packagedcode"

src/cluecode/copyrights.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,22 +1771,30 @@ def prep_line(line):
17711771
return line, chars_only.strip()
17721772

17731773

1774-
def is_candidate(prepped_line):
1774+
is_only_digit_and_punct = re.compile('^[^A-Za-z]+$').match
1775+
1776+
1777+
def is_candidate(prepared_line):
17751778
"""
1776-
Return True if a prepped line is a candidate line for copyright detection
1779+
Return True if a prepared line is a candidate line for copyright detection
17771780
"""
1778-
if not prepped_line:
1781+
if not prepared_line:
17791782
return False
1780-
if copyrights_hint.years(prepped_line):
1781-
# if TRACE: logger_debug('is_candidate: year in line:\n%(line)r' % locals())
1783+
1784+
if is_only_digit_and_punct(prepared_line):
1785+
if TRACE: logger_debug('is_candidate: is_only_digit_and_punct:\n%(prepared_line)r' % locals())
1786+
return False
1787+
1788+
if copyrights_hint.years(prepared_line):
1789+
# if TRACE: logger_debug('is_candidate: year in line:\n%(prepared_line)r' % locals())
17821790
return True
17831791
else:
1784-
# if TRACE: logger_debug('is_candidate: NOT year in line:\n%(line)r' % locals())
1792+
# if TRACE: logger_debug('is_candidate: NOT year in line:\n%(prepared_line)r' % locals())
17851793
pass
17861794

17871795
for marker in copyrights_hint.statement_markers:
1788-
if marker in prepped_line:
1789-
# if TRACE: logger_debug('is_candidate: %(marker)r in line:\n%(line)r' % locals())
1796+
if marker in prepared_line:
1797+
# if TRACE: logger_debug('is_candidate: %(marker)r in line:\n%(prepared_line)r' % locals())
17901798
return True
17911799

17921800

src/cluecode/finder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ def urls_regex():
206206

207207
def find_urls(location, unique=True):
208208
"""
209-
Yield urls found in file at location.
209+
Yield urls found in file at `location`.
210210
Only return unique items if unique is True.
211+
`location` can be a list of strings for testing.
211212
"""
212213
patterns = [('urls', urls_regex(),)]
213214
matches = find(location, patterns)

src/cluecode/finder_data.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ def set_from_text(text):
131131
http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd
132132
http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd
133133
http://gcc.gnu.org/bugs.html
134+
http://nsis.sf.net/NSIS_Error
134135
''')
135136

136-
JUNK_URL_PREFIXES = tuple(set_from_text('''
137+
138+
JUNK_URL_PREFIXES = tuple(sorted(set_from_text('''
137139
http://www.springframework.org/dtd/
138140
http://www.slickedit.com/dtd/
139141
http://www.oexchange.org/spec/0.8/
@@ -175,13 +177,28 @@ def set_from_text(text):
175177
https://www.w3.org/XML/1998/namespace
176178
http://www.w3.org/2000/xmlns/
177179
https://www.w3.org/2000/xmlns/
178-
'''))
179-
180-
JUNK_DOMAIN_SUFFIXES = tuple(set_from_text('''
180+
http://ts-aia.ws.symantec.com/
181+
https://ts-aia.ws.symantec.com/
182+
https://www.verisign.com/rpa
183+
http://csc3-2010-crl.verisign.com/
184+
https://www.verisign.com/rpa
185+
http://csc3-2010-aia.verisign.com/
186+
https://www.verisign.com/cps
187+
http://logo.verisign.com/
188+
http://ocsp2.globalsign.com/
189+
http://crl.globalsign.com/
190+
http://secure.globalsign.com/cacert/
191+
https://www.globalsign.com/repository/
192+
http://www.microsoft.com/pki/certs/
193+
http://www.microsoft.com/pkiops/crl
194+
http://www.microsoft.com/PKI/
195+
''')))
196+
197+
JUNK_DOMAIN_SUFFIXES = tuple(sorted(set_from_text('''
181198
.png
182199
.jpg
183200
.gif
184-
'''))
201+
''')))
185202

186203

187204
def classify(s, data_set, suffixes=None):

src/commoncode/text.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,17 @@ def python_safe_name(s):
194194
195195
For example:
196196
>>> s = "not `\\a /`good` -safe name ??"
197-
>>> assert python_safe_name(s) == 'not_good_safe_name'
197+
>>> assert python_safe_name(s) == 'not______good___safe_name'
198+
>>> s1 = "string1++or+"
199+
>>> s2 = "string1 +or "
200+
>>> assert python_safe_name(s1) == python_safe_name(s2)
198201
"""
199202
s = toascii(s)
200203
s = foldcase(s)
201204
s = nopunctuation(s)
202-
s = s.strip()
205+
s = s.replace(' ', '_')
203206
s = '_'.join(s.split())
207+
s = s.strip('_')
204208
return s
205209

206210

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Alfresco Software, Ltd. FLOSS License Exception
2+
3+
The Alfresco Software, Ltd. Exception for Free/Libre and Open Source Software-only Applications Using Alfresco software (the `FLOSS Exception').
4+
5+
Version 0.5, 30 August 2006
6+
Exception Intent
7+
8+
We want specified Free/Libre and Open Source Software ("FLOSS") applications to be able to use specified GPL-licensed Alfresco software (the "Program") despite the fact that not all FLOSS licenses are compatible with version 2 of the GNU General Public License (the "GPL").
9+
Legal Terms and Conditions
10+
11+
As a special exception to the terms and conditions of version 2.0 of the GPL:
12+
13+
You are free to distribute a Derivative Work that is formed entirely from the Program and one or more works (each, a "FLOSS Work") licensed under one or more of the licenses listed below in section 1, as long as:
14+
15+
You obey the GPL in all respects for the Program and the Derivative Work, except for identifiable sections of the Derivative Work which are not derived from the Program, and which can reasonably be considered independent and separate works in themselves,
16+
all identifiable sections of the Derivative Work which are not derived from the Program, and which can reasonably be considered independent and separate works in themselves,
17+
are distributed subject to one of the FLOSS licenses listed below, and
18+
the object code or executable form of those sections are accompanied by the complete corresponding machine-readable source code for those sections on the same medium and under the same FLOSS license as the corresponding object code or executable forms of those sections, and
19+
any works which are aggregated with the Program or with a Derivative Work on a volume of a storage or distribution medium in accordance with the GPL, can reasonably be considered independent and separate works in themselves which are not derivatives of either the Program, a Derivative Work or a FLOSS Work.
20+
21+
If the above conditions are not met, then the Program may only be copied, modified, distributed or used under the terms and conditions of the GPL or another valid licensing option from Alfresco Software, Ltd.
22+
1. FLOSS License List
23+
License name Version(s)/Copyright Date
24+
Academic Free License 2.0
25+
Apache Software License 1.0/1.1/2.0
26+
Apple Public Source License 2.0
27+
Artistic license From Perl 5.8.0
28+
BSD license "July 22 1999"
29+
Common Development and Distribution License (CDDL) 1.0
30+
Common Public License 1.0
31+
GNU Library or "Lesser" General Public License (LGPL) 2.0/2.1
32+
Jabber Open Source License 1.0
33+
MIT License (As listed in file MIT-License.txt) -
34+
Mozilla Public License (MPL) 1.0/1.1
35+
Open Software License 2.0
36+
OpenSSL license (with original SSLeay license) "2003" ("1998")
37+
PHP License 3.0
38+
Python license (CNRI Python License) -
39+
Python Software Foundation License 2.1.1
40+
Sleepycat License "1999"
41+
University of Illinois/NCSA Open Source License -
42+
W3C License "2001"
43+
X11 License "2001"
44+
Zlib/libpng License -
45+
Zope Public License 2.0
46+
47+
Due to the many variants of some of the above licenses, we require that any version follow the 2003 version of the Free Software Foundation's Free Software Definition (http://www.gnu.org/philosophy/free-sw.html) or version 1.9 of the Open Source Definition by the Open Source Initiative (http://www.opensource.org/docs/definition.php).
48+
2. Definitions
49+
50+
Terms used, but not defined, herein shall have the meaning provided in the GPL.
51+
Derivative Work means a derivative work under copyright law.
52+
53+
3. Applicability
54+
55+
This FLOSS Exception applies to all Programs that contain a notice placed by Alfresco Software, Ltd. saying that the Program may be distributed under the terms of this FLOSS Exception. If you create or distribute a work which is a Derivative Work of both the Program and any other work licensed under the GPL, then this FLOSS Exception is not available for that work; thus, you must remove the FLOSS Exception notice from that work and comply with the GPL in all respects, including by retaining all GPL notices. You may choose to redistribute a copy of the Program exclusively under the terms of the GPL by removing the FLOSS Exception notice from that copy of the Program, provided that the copy has never been modified by you or any third party.
56+
Appendix A. Qualified Libraries and Packages
57+
58+
The following is a a non-exhaustive list of libraries and packages which are covered by the FLOSS License Exception. Please note that appendix is merely provided as an additional service to specific FLOSS projects who wish to simplify licensing information for their users. Compliance with one of the licenses noted under the "FLOSS license list" section remains a prerequisite.
59+
Package name Qualifying License and Version
60+
Apache Portable Runtime (APR) Apache Software License 2.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
key: alfresco-exception-0.5
2+
name: Alfresco FLOSS Exception v0.5
3+
short_name: Alfresco FLOSS Exception v0.5
4+
category: Copyleft
5+
owner: Alfresco
6+
homepage_url: https://web.archive.org/web/20070306001556/http://www.alfresco.com/legal/licensing/floss_exception/
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
The `Blitz++ Artistic License'
2+
(with thanks and apologies to authors of the Perl Artistic License)
3+
4+
Preamble
5+
6+
The intent of this document is to state the conditions under which
7+
Blitz++ may be copied, such that the authors maintains some
8+
semblance of artistic control over the development of the package,
9+
while giving the users of the package the right to use and
10+
distribute Blitz++ in a more-or-less customary fashion, plus the
11+
right to make reasonable modifications.
12+
13+
Definitions
14+
15+
`Library' refers to the collection of files distributed by the
16+
Copyright Holder, and derivatives of that collection of files
17+
created through textual modification.
18+
19+
`Standard Version' refers to such a Library if it has not been
20+
modified, or has been modified in accordance with the wishes of the
21+
Copyright Holder as specified below.
22+
23+
Copyright Holder' is whoever is named in the copyright or
24+
copyrights for the package.
25+
26+
`You' is you, if you're thinking about copying, modifying or
27+
distributing this Library.
28+
29+
`Freely Available' means that no fee is charged for the item.
30+
It also means that recipients of the item may redistribute it
31+
under the same conditions they received it.
32+
33+
``Reasonable copying fee'' is whatever you can justify on the basis
34+
of media cost, duplication charges, time of people involved, and so
35+
on. (You will not be required to justify it to the Copyright Holder,
36+
but only to the computing community at large as a market that must
37+
bear the fee.)
38+
39+
1. You may make and give away verbatim copies of the
40+
Standard Version of this Library without restriction, provided that
41+
you duplicate all of the original copyright notices, this license,
42+
and associated disclaimers.
43+
44+
2. The Standard Version of the Library may be distributed as part
45+
of a collection of software, provided no more than a reasonable
46+
copying fee is charged for the software collection.
47+
48+
3. You may apply bug fixes, portability fixes and other modifications
49+
derived from the Public Domain or from the Copyright Holder. A
50+
Library modified in such a way shall still be considered the
51+
Standard Version.
52+
53+
4. You may otherwise modify your copy of this Library in any way,
54+
provided that you insert a prominent notice in each changed file
55+
stating how and when you changed that file, and provided that you do
56+
at least ONE of the following:
57+
58+
a. place your modifications in the Public Domain or otherwise
59+
make them Freely Available, such as by posting said
60+
modifications to the Blitz++ development list,
61+
and allowing the Copyright Holder to include
62+
your modifications in the Standard Version of the Library.
63+
64+
b. use the modified Library only within your corporation or
65+
organization.
66+
67+
c. make other distribution arrangements with the Copyright
68+
Holder.
69+
70+
5. You may distribute programs which use this Library
71+
in object code or executable form without restriction.
72+
73+
6. Any object code generated as a result of using this Library
74+
does not fall under the copyright of this Library, but
75+
belongs to whomever generated it, and may be sold commercially.
76+
77+
7. The name of the Copyright Holder or the Library may not be used to
78+
endorse or promote products derived from this software without
79+
specific prior written permission.
80+
81+
8. THIS PACKAGE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR
82+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
83+
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
key: blitz-artistic
2+
short_name: Blitz++ Artistic
3+
name: Blitz++ Artistic License
4+
category: Copyleft Limited
5+
owner: Blitz++
6+
homepage_url: https://github.com/blitzpp/blitz
7+
notes: This is a modified artistic license, no longer in use.
8+
text_urls:
9+
- https://raw.githubusercontent.com/blitzpp/blitz/e3c973d68e5ee17aec779bf9711b38fd4afc355f/LICENSE

0 commit comments

Comments
 (0)