fosslight-source 2.1.10__py3-none-any.whl → 2.1.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fosslight_source/_parsing_scancode_file_item.py +45 -12
- {fosslight_source-2.1.10.dist-info → fosslight_source-2.1.11.dist-info}/METADATA +1 -1
- {fosslight_source-2.1.10.dist-info → fosslight_source-2.1.11.dist-info}/RECORD +7 -7
- {fosslight_source-2.1.10.dist-info → fosslight_source-2.1.11.dist-info}/LICENSE +0 -0
- {fosslight_source-2.1.10.dist-info → fosslight_source-2.1.11.dist-info}/WHEEL +0 -0
- {fosslight_source-2.1.10.dist-info → fosslight_source-2.1.11.dist-info}/entry_points.txt +0 -0
- {fosslight_source-2.1.10.dist-info → fosslight_source-2.1.11.dist-info}/top_level.txt +0 -0
|
@@ -30,6 +30,27 @@ KEYWORD_SCANCODE_UNKNOWN = "unknown-spdx"
|
|
|
30
30
|
SPDX_REPLACE_WORDS = ["(", ")"]
|
|
31
31
|
KEY_AND = r"(?<=\s)and(?=\s)"
|
|
32
32
|
KEY_OR = r"(?<=\s)or(?=\s)"
|
|
33
|
+
GPL_LICENSE_PATTERN = r'((a|l)?gpl|gfdl)' # GPL, LGPL, AGPL, GFDL
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def is_gpl_family_license(licenses: list) -> bool:
|
|
37
|
+
if not licenses:
|
|
38
|
+
return False
|
|
39
|
+
|
|
40
|
+
for license_name in licenses:
|
|
41
|
+
if not license_name:
|
|
42
|
+
continue
|
|
43
|
+
|
|
44
|
+
license_lower = license_name.lower()
|
|
45
|
+
if re.search(GPL_LICENSE_PATTERN, license_lower):
|
|
46
|
+
logger.debug(f"GPL family license detected: {license_name}")
|
|
47
|
+
return True
|
|
48
|
+
|
|
49
|
+
return False
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def should_remove_copyright_for_gpl_license_text(licenses: list, is_license_text: bool) -> bool:
|
|
53
|
+
return is_license_text and is_gpl_family_license(licenses)
|
|
33
54
|
|
|
34
55
|
|
|
35
56
|
def get_error_from_header(header_item: list) -> Tuple[bool, str]:
|
|
@@ -100,8 +121,6 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
|
|
|
100
121
|
pass
|
|
101
122
|
copyright_value_list.append(copyright_data)
|
|
102
123
|
|
|
103
|
-
result_item.copyright = copyright_value_list
|
|
104
|
-
|
|
105
124
|
# Set the license value
|
|
106
125
|
license_detected = []
|
|
107
126
|
if licenses is None or licenses == "":
|
|
@@ -165,14 +184,21 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
|
|
|
165
184
|
if len(license_detected) > 0:
|
|
166
185
|
result_item.licenses = license_detected
|
|
167
186
|
|
|
187
|
+
if is_manifest_file(file_path):
|
|
188
|
+
result_item.is_license_text = True
|
|
189
|
+
|
|
190
|
+
# Remove copyright info for license text file of GPL family
|
|
191
|
+
if should_remove_copyright_for_gpl_license_text(license_detected, result_item.is_license_text):
|
|
192
|
+
logger.debug(f"Removing copyright for GPL family license text file: {file_path}")
|
|
193
|
+
result_item.copyright = []
|
|
194
|
+
else:
|
|
195
|
+
result_item.copyright = copyright_value_list
|
|
196
|
+
|
|
168
197
|
if len(license_expression_list) > 0:
|
|
169
198
|
license_expression_list = list(
|
|
170
199
|
set(license_expression_list))
|
|
171
200
|
result_item.comment = ','.join(license_expression_list)
|
|
172
201
|
|
|
173
|
-
if is_manifest_file(file_path):
|
|
174
|
-
result_item.is_license_text = True
|
|
175
|
-
|
|
176
202
|
if is_exclude_file(file_path, prev_dir, prev_dir_value):
|
|
177
203
|
result_item.exclude = True
|
|
178
204
|
scancode_file_item.append(result_item)
|
|
@@ -227,7 +253,6 @@ def parsing_scancode_32_later(
|
|
|
227
253
|
except Exception:
|
|
228
254
|
pass
|
|
229
255
|
copyright_value_list.append(copyright_data)
|
|
230
|
-
result_item.copyright = copyright_value_list
|
|
231
256
|
|
|
232
257
|
license_detected = []
|
|
233
258
|
licenses = file.get("license_detections", [])
|
|
@@ -263,6 +288,20 @@ def parsing_scancode_32_later(
|
|
|
263
288
|
license_list[lic_matched_key] = lic_info
|
|
264
289
|
license_detected.append(found_lic)
|
|
265
290
|
result_item.licenses = license_detected
|
|
291
|
+
|
|
292
|
+
result_item.exclude = is_exclude_file(file_path)
|
|
293
|
+
result_item.is_license_text = file.get("percentage_of_license_text", 0) > 90 or is_notice_file(file_path)
|
|
294
|
+
|
|
295
|
+
if is_manifest_file(file_path) and len(license_detected) > 0:
|
|
296
|
+
result_item.is_license_text = True
|
|
297
|
+
|
|
298
|
+
# Remove copyright info for license text file of GPL family
|
|
299
|
+
if should_remove_copyright_for_gpl_license_text(license_detected, result_item.is_license_text):
|
|
300
|
+
logger.debug(f"Removing copyright for GPL family license text file: {file_path}")
|
|
301
|
+
result_item.copyright = []
|
|
302
|
+
else:
|
|
303
|
+
result_item.copyright = copyright_value_list
|
|
304
|
+
|
|
266
305
|
if len(license_detected) > 1:
|
|
267
306
|
license_expression_spdx = file.get("detected_license_expression_spdx", "")
|
|
268
307
|
license_expression = file.get("detected_license_expression", "")
|
|
@@ -271,12 +310,6 @@ def parsing_scancode_32_later(
|
|
|
271
310
|
if license_expression:
|
|
272
311
|
result_item.comment = license_expression
|
|
273
312
|
|
|
274
|
-
result_item.exclude = is_exclude_file(file_path)
|
|
275
|
-
result_item.is_license_text = file.get("percentage_of_license_text", 0) > 90 or is_notice_file(file_path)
|
|
276
|
-
|
|
277
|
-
if is_manifest_file(file_path) and len(license_detected) > 0:
|
|
278
|
-
result_item.is_license_text = True
|
|
279
|
-
|
|
280
313
|
scancode_file_item.append(result_item)
|
|
281
314
|
except Exception as ex:
|
|
282
315
|
msg.append(f"Error Parsing item: {ex}")
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
fosslight_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
fosslight_source/_help.py,sha256=q3eKABhBrz8hvWSvmLVszStNpL18TCYLnUuefaU4V-M,2013
|
|
3
3
|
fosslight_source/_license_matched.py,sha256=-3H881XQjFDafRttBsuboS3VbCPYEvPH1pwWXptknE4,2164
|
|
4
|
-
fosslight_source/_parsing_scancode_file_item.py,sha256=
|
|
4
|
+
fosslight_source/_parsing_scancode_file_item.py,sha256=w7-oX02gtpQ1oafeRK2hYDBsVBZ16rjkM91lc5GKY7c,15162
|
|
5
5
|
fosslight_source/_parsing_scanoss_file.py,sha256=IgqLf9cufc9qTLtdr_t1JSs8lRsCC4utlvpogAMtryg,4214
|
|
6
6
|
fosslight_source/_scan_item.py,sha256=Y13SRq3PCeHvzqZonGphkt9X1LXqmdWgYnnBI1QT8n8,5997
|
|
7
7
|
fosslight_source/cli.py,sha256=2TuHZvDKUp8R12DM9gesTF23RT7OBw968AdzNLtVanU,16650
|
|
8
8
|
fosslight_source/run_scancode.py,sha256=leq-FuGwX-kBg-sNZXQ-DSKy-uTj7w2QBFeOLgyvPxc,7094
|
|
9
9
|
fosslight_source/run_scanoss.py,sha256=8wu3sa-YBqjfb5x2dbDJuAdw3rrExueOW23WdzqDCaU,5721
|
|
10
10
|
fosslight_source/run_spdx_extractor.py,sha256=Hr9sTv06cJaVITy8amwexIW2FV8_rUcFw6hKmR9ZYws,1990
|
|
11
|
-
fosslight_source-2.1.
|
|
12
|
-
fosslight_source-2.1.
|
|
13
|
-
fosslight_source-2.1.
|
|
14
|
-
fosslight_source-2.1.
|
|
15
|
-
fosslight_source-2.1.
|
|
16
|
-
fosslight_source-2.1.
|
|
11
|
+
fosslight_source-2.1.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
fosslight_source-2.1.11.dist-info/METADATA,sha256=AVk1oM8tvIjN1nA5CXBLFLAbDrSIn98J8fnoXp77PnU,3219
|
|
13
|
+
fosslight_source-2.1.11.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
14
|
+
fosslight_source-2.1.11.dist-info/entry_points.txt,sha256=G4bBRWqSrJ68g-2M-JtNDrSZsdym_M7_KohQ2qR1vG8,113
|
|
15
|
+
fosslight_source-2.1.11.dist-info/top_level.txt,sha256=C2vw-0OIent84Vq-UEk1gt_kK1EL8dIItzBzp3WNyA4,17
|
|
16
|
+
fosslight_source-2.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|