Skip to content

Commit c8cdca3

Browse files
authored
Merge pull request #3030 from nexB/early-summer-q3-license-updates2
Improve license detection with rules and licenses
2 parents 7d1a675 + c5bc4bd commit c8cdca3

File tree

378 files changed

+2561
-116
lines changed

Some content is hidden

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

378 files changed

+2561
-116
lines changed

etc/scripts/licenses/synclic.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ class DejaSource(ExternalLicensesSource):
530530
"is_deprecated",
531531
"is_exception",
532532
# not yet
533+
# "notes",
533534
# "standard_notice",
534535
)
535536
non_updatable_attributes = ("notes",)
@@ -601,6 +602,8 @@ def build_license(self, mapping, *args, **kwargs):
601602
key = mapping["key"]
602603
standard_notice = mapping.get("standard_notice") or ""
603604
standard_notice = clean_text(standard_notice)
605+
# notes = mapping.get("reference_notes") or ""
606+
# notes = clean_text(notes)
604607

605608
deprecated = not mapping.get("is_active")
606609
spdx_license_key = mapping.get("spdx_license_key") or None
@@ -629,6 +632,7 @@ def build_license(self, mapping, *args, **kwargs):
629632
is_exception=mapping.get("is_exception", False),
630633
is_deprecated=deprecated,
631634
standard_notice=standard_notice,
635+
# notes=notes,
632636
)
633637
text = mapping["full_text"] or ""
634638
# normalize EOL to POSIX
@@ -994,6 +998,7 @@ def update_external(_attrib, _sc_val, _ext_val):
994998
update_scancode(attrib, scancode_value, external_value)
995999
continue
9961000

1001+
# We merge sequences
9971002
if isinstance(scancode_value, (list, tuple)) and isinstance(external_value, (list, tuple)):
9981003
normalized_scancode_value = set(s for s in scancode_value if s and s.strip())
9991004
normalize_external_value = set(s for s in external_value if s and s.strip())
@@ -1034,8 +1039,7 @@ def update_external(_attrib, _sc_val, _ext_val):
10341039
continue
10351040

10361041
if isinstance(scancode_value, str) and isinstance(external_value, str):
1037-
# keep the stripped and normalized spaces value
1038-
# normalized spaces
1042+
# make value stripped and with normalized spaces
10391043
normalized_scancode_value = " ".join(scancode_value.split())
10401044
normalize_external_value = " ".join(external_value.split())
10411045

@@ -1165,9 +1169,9 @@ def synchronize_licenses(
11651169

11661170
# the matching key exists on both sides: merge/update both licenses
11671171
scancode_updated, external_updated = merge_licenses(
1168-
scancode_license,
1169-
external_license,
1170-
external_source.updatable_attributes,
1172+
scancode_license=scancode_license,
1173+
external_license=external_license,
1174+
updatable_attributes=external_source.updatable_attributes,
11711175
from_spdx=use_spdx_key,
11721176
)
11731177

foo.html

+35
Large diffs are not rendered by default.

ht.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from licensedcode.cache import get_index
2+
idx = get_index()
3+
file= "sample.license.txt"
4+
matches = idx.match(location=file)
5+
for match in matches:
6+
ht = match.get_highlighted_text()
7+
print(ht)

sample.license.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) Django Software Foundation and individual contributors.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright
11+
notice, this list of FOOBAR conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
14+
3. Neither the name of Django nor the names of its contributors may be used
15+
to endorse or promote products derived from this software without
16+
specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

src/licensedcode/data/licenses/anti-capitalist-1.4.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
key: anti-capitalist-1.4
22
short_name: ACSL v. 1.4
3-
name: ANTI-CAPITALIST SOFTWARE LICENSE (v 1.4)
3+
name: Anti-Capitalist Software License (v 1.4)
44
category: Free Restricted
55
owner: Everest Pipkin and Ramsey Nasser
66
homepage_url: https://anticapitalist.software/

src/licensedcode/data/licenses/app-s2p.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ key: app-s2p
22
short_name: App::s2p License
33
name: App::s2p License
44
category: Permissive
5-
owner: Unspecified
5+
owner: Fedora
6+
homepage_url: https://fedoraproject.org/wiki/Licensing/App-s2p
67
spdx_license_key: App-s2p
78
other_urls:
89
- https://fedoraproject.org/wiki/Licensing/App-s2p

src/licensedcode/data/licenses/bohl-0.2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ key: bohl-0.2
22
short_name: BOHL-0.2
33
name: The Balloon Open Hardware License v0.2
44
category: Permissive
5-
owner: The Balloon
5+
owner: iTechnic
66
spdx_license_key: LicenseRef-scancode-bohl-0.2
77
text_urls:
88
- https://web.archive.org/web/20140426215620/http://www.balloonboard.org/docs/Balloon_License_0v2.pdf

src/licensedcode/data/licenses/cc-by-nc-sa-2.0-fr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ key: cc-by-nc-sa-2.0-fr
22
language: fr
33
short_name: CC-BY-NC-SA-2.0-FR
44
name: Creative Commons Attribution-NonCommercial-ShareAlike 2.0 France
5-
category: Free Restricted
5+
category: Source-available
66
owner: Creative Commons
77
spdx_license_key: CC-BY-NC-SA-2.0-FR
88
other_urls:

src/licensedcode/data/licenses/cc-by-nc-sa-3.0-de.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ key: cc-by-nc-sa-3.0-de
22
language: de
33
short_name: CC-BY-NC-SA-3.0-DE
44
name: Creative Commons Attribution Non Commercial Share Alike 3.0 Germany
5-
category: Free Restricted
5+
category: Source-available
66
owner: Creative Commons
77
spdx_license_key: CC-BY-NC-SA-3.0-DE
88
other_urls:

src/licensedcode/data/licenses/cc-by-sa-1.0.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
key: cc-by-sa-1.0
22
short_name: CC-BY-SA-1.0
33
name: Creative Commons Attribution Share Alike License 1.0
4-
category: Permissive
4+
category: Copyleft Limited
55
owner: Creative Commons
66
homepage_url: http://creativecommons.org/licenses/by-sa/1.0/
77
spdx_license_key: CC-BY-SA-1.0

src/licensedcode/data/licenses/cc-by-sa-4.0.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
key: cc-by-sa-4.0
22
short_name: CC-BY-SA-4.0
33
name: Creative Commons Attribution-ShareAlike 4.0 International Public License
4-
category: Copyleft
4+
category: Copyleft Limited
55
owner: Creative Commons
66
homepage_url: http://creativecommons.org/licenses/by-sa/4.0/
77
spdx_license_key: CC-BY-SA-4.0

src/licensedcode/data/licenses/cc-gpl-2.0-pt.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ key: cc-gpl-2.0-pt
22
language: pt
33
short_name: CC-GPL-2.0-PT
44
name: Creative Commons Licença Pública Geral do GNU (GPL) [General Public License]
5-
category: Copyleft Limited
5+
category: Copyleft
66
owner: Creative Commons
77
homepage_url: https://creativecommons.org/licenses/GPL/2.0/
88
spdx_license_key: LicenseRef-scancode-cc-gpl-2.0-pt

src/licensedcode/data/licenses/cecill-c-en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
key: cecill-c-en
22
short_name: CeCILL-C License English
33
name: CeCILL-C Free Software License Agreement English
4-
category: Copyleft
4+
category: Copyleft Limited
55
owner: CeCILL
66
homepage_url: http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html
77
notes: "This is the English translation of \nhttp://www.cecill.info/licences/Licence_CeCILL-C_V1-fr.html\n"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
Cloud Native Computing Foundation
2+
A project of The Linux Foundation
3+
Software Grant and Corporate Contributor License Agreement ("Agreement") v1.0
4+
5+
Thank you for your interest in the Cloud Native Computing Foundation project (“CNCF”) of The
6+
Linux Foundation (the "Foundation"). In order to clarify the intellectual property license granted
7+
with Contributions from any person or entity, the Foundation must have a Contributor License
8+
Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the
9+
license terms below. This license is for your protection as a Contributor as well as the protection
10+
of CNCF, the Foundation and its users; it does not change your rights to use your own
11+
Contributions for any other purpose.
12+
13+
This version of the Agreement allows an entity (the "Corporation") to submit Contributions to the
14+
Foundation, to authorize Contributions submitted by its designated employees to the
15+
Foundation, and to grant copyright and patent licenses thereto.
16+
17+
If you have not already done so, please complete and sign, then scan and email a PDF file of
18+
this Agreement to ​[email protected]
19+
If necessary, send an original signed Agreement to The Linux
20+
Foundation, 1 Letterman Drive, Building D, Suite D4700, San Francisco CA 94129, U.S.A.
21+
Please read this document carefully before signing and keep a copy for your records.
22+
23+
 Corporation name: ________________________________________________
24+
 Corporation address: ________________________________________________
25+
 ________________________________________________
26+
 ________________________________________________
27+
28+
 Point of Contact: ________________________________________________
29+
 E­Mail: ________________________________________________
30+
 Telephone: _____________________
31+
32+
You accept and agree to the following terms and conditions for Your present and future
33+
Contributions submitted to the Foundation. In return, the Foundation shall not use Your
34+
Contributions in a way that is contrary to the public benefit or inconsistent with its nonprofit
35+
status and bylaws in effect at the time of the Contribution. Except for the license granted herein
36+
to the Foundation and recipients of software distributed by the Foundation, You reserve all right,
37+
title, and interest in and to Your Contributions.
38+
39+
 1. Definitions.
40+
41+
 "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright
42+
owner that is making this Agreement with the Foundation. For legal entities, the entity making a
43+
Contribution and all other entities that control, are controlled by, or are under common control
44+
with that entity are considered to be a single Contributor. For the purposes of this definition,
45+
"control" means (i) the power, direct or indirect, to cause the direction or management of such
46+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
47+
outstanding shares, or (iii) beneficial ownership of such entity.
48+
49+
 "Contribution" shall mean the code, documentation or other original works of authorship
50+
expressly identified in Schedule B, as well as any original work of authorship, including any
51+
modifications or additions to an existing work, that is intentionally submitted by You to the
52+
Foundation for inclusion in, or documentation of, any of the products owned or managed by the
53+
Foundation (the "Work"). For the purposes of this definition, "submitted" means any form of
54+
electronic, verbal, or written communication sent to the Foundation or its representatives,
55+
including but not limited to communication on electronic mailing lists, source code control
56+
systems, and issue tracking systems that are managed by, or on behalf of, the Foundation for
57+
the purpose of discussing and improving the Work, but excluding communication that is
58+
conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
59+
60+
 2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You
61+
hereby grant to the Foundation and to recipients of software distributed by the Foundation a
62+
perpetual, worldwide, non­exclusive, no­charge, royalty­free, irrevocable copyright license to
63+
reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and
64+
distribute Your Contributions and such derivative works.
65+
66+
 3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby
67+
grant to the Foundation and to recipients of software distributed by the Foundation a perpetual,
68+
worldwide, non­exclusive, no­charge, royalty­free, irrevocable (except as stated in this section)
69+
patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the
70+
Work, where such license applies only to those patent claims licensable by You that are
71+
necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s)
72+
with the Work to which such Contribution(s) were submitted. If any entity institutes patent
73+
litigation against You or any other entity (including a cross­claim or counterclaim in a lawsuit)
74+
alleging that your Contribution, or the Work to which you have contributed, constitutes direct or
75+
contributory patent infringement, then any patent licenses granted to that entity under this
76+
Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
77+
78+
 4. You represent that You are legally entitled to grant the above license. You represent further
79+
that each employee of the Corporation designated on Schedule A below (or in a subsequent
80+
written modification to that Schedule) is authorized to submit Contributions on behalf of the
81+
Corporation.
82+
83+
 5. You represent that each of Your Contributions is Your original creation (see section 7 for
84+
submissions on behalf of others).
85+
86+
 6. You are not expected to provide support for Your Contributions, except to the extent You
87+
desire to provide support. You may provide support for free, for a fee, or not at all. Unless
88+
required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS"
89+
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
90+
including, without limitation, any warranties or conditions of TITLE, NON­INFRINGEMENT,
91+
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
92+
93+
 7. Should You wish to submit work that is not Your original creation, You may submit it to the
94+
Foundation separately from any Contribution, identifying the complete details of its source and
95+
of any license or other restriction (including, but not limited to, related patents, trademarks, and
96+
license agreements) of which you are personally aware, and conspicuously marking the work as
97+
"Submitted on behalf of a third­party: [named here]".
98+
99+
 8. It is your responsibility to notify the Foundation when any change is required to the list of
100+
designated employees authorized to submit Contributions on behalf of the Corporation, or to the
101+
Corporation's Point of Contact with the Foundation.
102+
103+
104+
105+
Please sign: __________________________________ Date: _______________
106+
107+
Title: __________________________________
108+
109+
Corporation: __________________________________
110+
111+
112+
Schedule A
113+
114+
Initial list of designated employees. NB: authorization is not tied to particular Contributions.
115+
Please indicate “CLA Manager” next to the name of any employees listed below that are
116+
authorized to add or remove designated employees from this list in the future.
117+
118+
119+
120+
Schedule B
121+
122+
[Identification of optional concurrent software grant. Would be left blank or omitted if there is no
123+
concurrent software grant.]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
key: cncf-corporate-cla-1.0
2+
short_name: CNCF Corporate CLA 1.0
3+
name: Software Grant and Corporate Contributor License Agreement ("Agreement") v1.0
4+
category: Patent License
5+
owner: Linux Foundation
6+
homepage_url: https://github.com/cncf/cla/blob/master/corporate-cla.pdf
7+
spdx_license_key: LicenseRef-scancode-cncf-corporate-cla-1.0
8+
faq_url: https://github.com/kubernetes/community/blob/master/CLA.md
9+
ignorable_emails:
10+
11+

0 commit comments

Comments
 (0)