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

Modify the oss info for local package of cocoapods #189

Merged
merged 1 commit into from
Feb 29, 2024
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
9 changes: 6 additions & 3 deletions src/fosslight_dependency/package_manager/Cocoapods.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def parse_oss_information(self, f_name):
try:
comment_list = []
deps_list = []
if self.direct_dep:
if self.direct_dep and (len(self.direct_dep_list) > 0):
if pod_oss_name_origin in self.direct_dep_list:
comment_list.append('direct')
else:
Expand All @@ -98,10 +98,12 @@ def parse_oss_information(self, f_name):
comment = ','.join(comment_list)
deps = ','.join(deps_list)

oss_name_report = f'{self.package_manager_name}:{pod_oss_name_origin}'
pod_oss_name = pod_oss_name_origin
if '/' in pod_oss_name_origin:
pod_oss_name = pod_oss_name_origin.split('/')[0]
if pod_oss_name in external_source_list:
oss_name_report = pod_oss_name_origin
podspec_filename = pod_oss_name + '.podspec.json'
spec_file_path = os.path.join("Pods", "Local Podspecs", podspec_filename)
else:
Expand All @@ -126,13 +128,14 @@ def parse_oss_information(self, f_name):
spec_file_path = os.path.join(file_path_without_version, pod_oss_version, file_path[-1])

oss_name, oss_version, license_name, dn_loc, homepage = self.get_oss_in_podspec(spec_file_path)
if pod_oss_name in external_source_list:
homepage = dn_loc
if oss_name == '':
continue
if pod_oss_version != oss_version:
logger.warning(f'{pod_oss_name_origin} has different version({pod_oss_version})\
with spec version({oss_version})')
sheet_list.append([const.SUPPORT_PACKAE.get(self.package_manager_name),
f'{self.package_manager_name}:{pod_oss_name_origin}',
sheet_list.append([const.SUPPORT_PACKAE.get(self.package_manager_name), oss_name_report,
pod_oss_version, license_name, dn_loc, homepage, '', '', comment, deps])
except Exception as e:
logger.warning(f"Fail to get {pod_oss_name_origin}:{e}")
Expand Down
Loading