Skip to content

Commit 41fd4b8

Browse files
committed
Improve detection of CC0 license
We now better detect specific CC0 notices seen in Debian copyright files Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 58d42f9 commit 41fd4b8

File tree

9 files changed

+94
-60
lines changed

9 files changed

+94
-60
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Certain owners wish to permanently relinquish those rights to a Work for
2+
the purpose of contributing to a commons of creative, cultural and
3+
scientific works ("Commons") that the public can reliably and without
4+
fear of later claims of infringement build upon, modify, incorporate in
5+
other works, reuse and redistribute as freely as possible in any form
6+
whatsoever and for any purposes, including without limitation commercial
7+
purposes. These owners may contribute to the Commons to promote the
8+
ideal of a free culture and the further production of creative, cultural
9+
and scientific works, or to gain reputation or greater distribution for
10+
their Work in part through the use and efforts of others.
11+
.
12+
For these and/or other purposes and motivations, and without any
13+
expectation of additional consideration or compensation, the person
14+
associating CC0 with a Work (the "Affirmer"), to the extent that he or
15+
she is an owner of Copyright and Related Rights in the Work, voluntarily
16+
elects to apply CC0 to the Work and publicly distribute the Work under
17+
its terms, with knowledge of his or her Copyright and Related Rights in
18+
the Work and the meaning and intended legal effect of CC0 on those
19+
rights.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
license_expression: cc0-1.0
2+
is_license_notice: yes
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
For these and/or other purposes and motivations, and without any
2+
expectation of additional consideration or compensation, the person
3+
associating CC0 with a Work (the "Affirmer"), to the extent that he or
4+
she is an owner of Copyright and Related Rights in the Work, voluntarily
5+
elects to apply CC0 to the Work and publicly distribute the Work under
6+
its terms, with knowledge of his or her Copyright and Related Rights in
7+
the Work and the meaning and intended legal effect of CC0 on those
8+
rights.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
license_expression: cc0-1.0
2+
is_license_notice: yes
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Certain owners wish to permanently relinquish those rights to a Work for
2+
the purpose of contributing to a commons of creative, cultural and
3+
scientific works ("Commons") that the public can reliably and without
4+
fear of later claims of infringement build upon, modify, incorporate in
5+
other works, reuse and redistribute as freely as possible in any form
6+
whatsoever and for any purposes, including without limitation commercial
7+
purposes. These owners may contribute to the Commons to promote the
8+
ideal of a free culture and the further production of creative, cultural
9+
and scientific works, or to gain reputation or greater distribution for
10+
their Work in part through the use and efforts of others.
11+
.
12+
For these and/or other purposes and motivations, and without any
13+
expectation of additional consideration or compensation, the person
14+
associating CC0 with a Work (the "Affirmer"), to the extent that he or
15+
she is an owner of Copyright and Related Rights in the Work, voluntarily
16+
elects to apply CC0 to the Work and publicly distribute the Work under
17+
its terms, with knowledge of his or her Copyright and Related Rights in
18+
the Work and the meaning and intended legal effect of CC0 on those
19+
rights.
20+
The complete text of the Creative Commons 0 1.0 Universal
21+
can be found in `/usr/share/common-licenses/CC0-1.0'.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
license_expression: cc0-1.0
2+
is_license_notice: yes
3+
referenced_filenames:
4+
- /usr/share/common-licenses/CC0-1.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
text of the Creative Commons 0 1.0 Universal
2+
can be found in `/usr/share/common-licenses/CC0-1.0'.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
license_expression: cc0-1.0
2+
is_license_notice: yes
3+
referenced_filenames:
4+
- /usr/share/common-licenses/CC0-1.0

tests/packagedcode/data/debian/copyright/debian-2019-11-15/main/e/epiphany-browser/stable_copyright-detailed.expected.yml

Lines changed: 32 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ declared_license:
1919
- CC0-1.0
2020
- CC-BY-SA-3.0
2121
- CC-BY-SA-4.0
22-
license_expression: (gpl-3.0-plus AND gpl-3.0-plus) AND (cc0-1.0 AND cc0-1.0 AND cc0-1.0 AND
23-
cc0-1.0 AND cc0-1.0) AND (gpl-2.0-plus AND gpl-2.0-plus) AND (gpl-3.0-plus AND gpl-3.0-plus)
24-
AND cc-by-sa-3.0 AND (lgpl-2.0-plus AND lgpl-2.0-plus) AND (lgpl-2.0-plus AND lgpl-2.0-plus)
25-
AND (lgpl-2.0-plus AND lgpl-2.0-plus) AND (lgpl-2.0-plus AND lgpl-2.0-plus) AND (apache-2.0
26-
AND apache-2.0) AND (gpl-3.0-plus AND gpl-3.0-plus) AND (cc-by-sa-4.0 AND cc-by-sa-4.0)
22+
license_expression: (gpl-3.0-plus AND gpl-3.0-plus) AND (cc0-1.0 AND cc0-1.0) AND (gpl-2.0-plus
23+
AND gpl-2.0-plus) AND (gpl-3.0-plus AND gpl-3.0-plus) AND cc-by-sa-3.0 AND (lgpl-2.0-plus
24+
AND lgpl-2.0-plus) AND (lgpl-2.0-plus AND lgpl-2.0-plus) AND (lgpl-2.0-plus AND lgpl-2.0-plus)
25+
AND (lgpl-2.0-plus AND lgpl-2.0-plus) AND (apache-2.0 AND apache-2.0) AND (gpl-3.0-plus AND
26+
gpl-3.0-plus) AND (cc-by-sa-4.0 AND cc-by-sa-4.0)
2727
copyright: |
2828
2009-2018 Igalia S.L
2929
2002 Jorn Baayen
@@ -272,70 +272,42 @@ matches:
272272
is_license_tag: yes
273273
is_license_intro: no
274274
matched_text: 'License: cc0-1.0'
275-
- score: '50.0'
276-
start_line: 171
277-
end_line: 171
278-
matcher: 2-aho
279-
rule_length: 1
280-
matched_length: 1
281-
match_coverage: '100.0'
282-
rule_relevance: 50
283-
identifier: cc0-1.0_176.RULE
284-
license_expression: cc0-1.0
285-
is_license_text: no
286-
is_license_notice: no
287-
is_license_reference: yes
288-
is_license_tag: no
289-
is_license_intro: no
290-
matched_text: CC0
291-
- score: '50.0'
292-
start_line: 173
293-
end_line: 173
294-
matcher: 2-aho
295-
rule_length: 1
296-
matched_length: 1
297-
match_coverage: '100.0'
298-
rule_relevance: 50
299-
identifier: cc0-1.0_176.RULE
300-
license_expression: cc0-1.0
301-
is_license_text: no
302-
is_license_notice: no
303-
is_license_reference: yes
304-
is_license_tag: no
305-
is_license_intro: no
306-
matched_text: CC0
307-
- score: '50.0'
308-
start_line: 175
309-
end_line: 175
310-
matcher: 2-aho
311-
rule_length: 1
312-
matched_length: 1
313-
match_coverage: '100.0'
314-
rule_relevance: 50
315-
identifier: cc0-1.0_176.RULE
316-
license_expression: cc0-1.0
317-
is_license_text: no
318-
is_license_notice: no
319-
is_license_reference: yes
320-
is_license_tag: no
321-
is_license_intro: no
322-
matched_text: CC0
323275
- score: '100.0'
324-
start_line: 178
276+
start_line: 158
325277
end_line: 179
326-
matcher: 2-aho
327-
rule_length: 22
328-
matched_length: 22
278+
matcher: 1-hash
279+
rule_length: 213
280+
matched_length: 213
329281
match_coverage: '100.0'
330282
rule_relevance: 100
331-
identifier: cc0-1.0_162.RULE
283+
identifier: cc0-1.0_186.RULE
332284
license_expression: cc0-1.0
333285
is_license_text: no
334-
is_license_notice: no
335-
is_license_reference: yes
286+
is_license_notice: yes
287+
is_license_reference: no
336288
is_license_tag: no
337289
is_license_intro: no
338290
matched_text: |
291+
Certain owners wish to permanently relinquish those rights to a Work for
292+
the purpose of contributing to a commons of creative, cultural and
293+
scientific works ("Commons") that the public can reliably and without
294+
fear of later claims of infringement build upon, modify, incorporate in
295+
other works, reuse and redistribute as freely as possible in any form
296+
whatsoever and for any purposes, including without limitation commercial
297+
purposes. These owners may contribute to the Commons to promote the
298+
ideal of a free culture and the further production of creative, cultural
299+
and scientific works, or to gain reputation or greater distribution for
300+
their Work in part through the use and efforts of others.
301+
302+
For these and/or other purposes and motivations, and without any
303+
expectation of additional consideration or compensation, the person
304+
associating CC0 with a Work (the "Affirmer"), to the extent that he or
305+
she is an owner of Copyright and Related Rights in the Work, voluntarily
306+
elects to apply CC0 to the Work and publicly distribute the Work under
307+
its terms, with knowledge of his or her Copyright and Related Rights in
308+
the Work and the meaning and intended legal effect of CC0 on those
309+
rights.
310+
.
339311
The complete text of the Creative Commons 0 1.0 Universal
340312
can be found in `/usr/share/common-licenses/CC0-1.0'.
341313
- score: '97.8'

0 commit comments

Comments
 (0)