Skip to content

Commit 341de6e

Browse files
authored
Merge pull request #75 from fosslight/develop
Fix the error to write opossum
2 parents fd08231 + 523a038 commit 341de6e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/fosslight_util/write_opossum.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,17 @@ def make_resources_and_attributions(sheet_items, scanner, resources, fc_list):
266266
resources = make_resources(path, resources)
267267
attribution = Attribution(scanner, license, exclude, copyright, oss_name, oss_version, url)
268268
elif scanner == constant.FL_DEPENDENCY:
269-
if path != '':
269+
try:
270270
packageType = PACKAGE[path]
271-
else:
271+
except Exception:
272272
packageType = ''
273-
if oss_name.split(':')[0] in PACKAGE.items():
274-
packageType = oss_name.split(':')[0]
273+
if path == '':
274+
try_package_type = oss_name.split(':')[0]
275+
else:
276+
try_package_type = path.split(',')[0]
277+
if try_package_type in PACKAGE.items():
278+
packageType = try_package_type
279+
275280
if (os.path.join(os.sep, path) + os.sep) not in fc_list:
276281
fc_list.append(os.path.join(os.sep, path) + os.sep)
277282
ab_list.append(os.path.join(os.sep, path, packageType) + os.sep)

0 commit comments

Comments
 (0)