Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the pub result parsing bug #237

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/fosslight_dependency/package_manager/Pub.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def parse_oss_information(self, f_name):
continue
oss_item.name = f"{self.package_manager_name}:{oss_origin_name}"
oss_item.version = json_data['version']
if oss_item.version is None:
oss_item.version = ''
oss_item.homepage = json_data['homepage']
if oss_item.homepage is None:
oss_item.homepage = json_data['repository']
Expand All @@ -130,17 +132,19 @@ def parse_oss_information(self, f_name):
dep_item.purl = get_url_to_purl(oss_item.download_location, self.package_manager_name)
purl_dict[f'{oss_origin_name}({oss_item.version})'] = dep_item.purl
license_txt = json_data['license']
if license_txt is not None:
tmp_license_txt = open(tmp_license_txt_file_name, 'w', encoding='utf-8')
tmp_license_txt.write(license_txt)
tmp_license_txt.close()

tmp_license_txt = open(tmp_license_txt_file_name, 'w', encoding='utf-8')
tmp_license_txt.write(license_txt)
tmp_license_txt.close()
license_name_with_license_scanner = check_and_run_license_scanner(self.platform,
self.license_scanner_bin,
tmp_license_txt_file_name)

license_name_with_license_scanner = check_and_run_license_scanner(self.platform,
self.license_scanner_bin,
tmp_license_txt_file_name)

if license_name_with_license_scanner != "":
oss_item.license = license_name_with_license_scanner
if license_name_with_license_scanner != "":
oss_item.license = license_name_with_license_scanner
else:
oss_item.license = ''

if self.direct_dep:
if oss_origin_name not in self.total_dep_list:
Expand Down
Loading