Skip to content

Commit

Permalink
Modify to remove dup. oss
Browse files Browse the repository at this point in the history
  • Loading branch information
bjk7119 committed Jan 13, 2025
1 parent 07a4fba commit 1e5f07d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/fosslight_binary/_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ def __init__(self, value):
self.vulnerability_items = []
self.binary_name_without_path = ""
self.bin_name_with_path = value
self.found_in_owasp = False
self.is_binary = True
self.found_in_owasp = False
self.found_in_bin_db = False # for debugging

def __del__(self):
pass
Expand Down
11 changes: 10 additions & 1 deletion src/fosslight_binary/_binary_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,20 @@ def get_oss_info_from_db(bin_info_list, dburl=""):
for idx, row in df_result.iterrows():
if not item.found_in_owasp:
oss_from_db = OssItem(row['ossname'], row['ossversion'], row['license'])
bin_oss_items.append(oss_from_db)

if bin_oss_items:
for ossItem in bin_oss_items:
if not (ossItem.name == oss_from_db.name
and ossItem.version == oss_from_db.version
and ossItem.license == oss_from_db.license):
bin_oss_items.append(oss_from_db)
else:
bin_oss_items.append(oss_from_db)

if bin_oss_items:
item.set_oss_items(bin_oss_items)
item.comment = "Binary DB result"
item.found_in_binary = True

disconnect_lge_bin_db()
return bin_info_list, _cnt_auto_identified
Expand Down

0 comments on commit 1e5f07d

Please sign in to comment.