Skip to content

Commit a9b3ace

Browse files
authored
Merge pull request #15 from fosslight/fix
Update the information on the cover sheet
2 parents 6e2447d + 721763f commit a9b3ace

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/fosslight_android/_write_excel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def write_result_to_excel(out_file_name, row_list, cover=''):
16-
header_row = ['ID', 'Binary Name', 'Source Code Path', 'NOTICE.html', 'OSS Name', 'OSS Version', 'License',
16+
header_row = ['ID', 'Binary Name', 'Source Code Path', 'Notice', 'OSS Name', 'OSS Version', 'License',
1717
'Download Location', 'Homepage',
1818
'Copyright Text',
1919
'License Text', 'Exclude', 'Comment', 'Need Check', 'TLSH', 'SHA1']

src/fosslight_android/android_binary_analysis.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,21 +327,24 @@ def get_result_of_notice_html(found_on_html, notice_file_found):
327327

328328
def find_notice_value():
329329
global notice_file_list, final_bin_info
330+
str_notice_files = ""
330331

331332
try:
332333
notice_file_list, notice_files = read_notice_file(os.path.abspath(build_out_notice_file_path), NOTICE_HTML_FILE_NAME)
333334
if not notice_file_list:
334335
logger.info(f"Notice file is empty:{notice_files}")
335336
return
336337
if notice_files:
337-
logger.info(f"Notice files:{notice_files}")
338+
str_notice_files = ",".join(notice_files)
339+
logger.info(f"Notice files:{str_notice_files}")
338340
else:
339341
logger.debug("Can't find a notiece file")
340342
return_list = do_multi_process(find_notice_html, final_bin_info)
341343
final_bin_info = return_list[:]
342344

343345
except IOError as error: # 'CANNOT_FIND_NOTICE_HTML'
344346
logger.debug(f"find_notice_value:{error}")
347+
return str_notice_files
345348

346349

347350
def find_notice_html(bin_info, return_list):
@@ -769,6 +772,7 @@ def main():
769772
num_cores = 1
770773

771774
python_script_dir = os.getcwd()
775+
android_src_path = python_script_dir
772776
now = datetime.now().strftime('%y%m%d_%H%M')
773777
log_txt_file = os.path.join(python_script_dir, f"fosslight_log_android_{now}.txt")
774778
result_excel_file = os.path.join(python_script_dir, f"fosslight_report_android_{now}.xlsx")
@@ -798,6 +802,7 @@ def main():
798802
print_version(PKG_NAME)
799803
if args.source: # android source path
800804
os.chdir(args.source)
805+
android_src_path = args.source
801806
if args.binary: # Base model's binary.txt to exclude
802807
base_binary_txt = args.binary
803808
if args.notice:
@@ -842,7 +847,7 @@ def main():
842847

843848
map_binary_module_name_and_path(find_binaries_from_out_dir())
844849

845-
find_notice_value()
850+
notice_files = find_notice_value()
846851
find_bin_license_info()
847852

848853
set_mk_file_path() # Mk file path and local path, location of NOTICE file, can be different
@@ -858,8 +863,9 @@ def main():
858863

859864
cover = CoverItem(tool_name=PKG_NAME,
860865
start_time=now,
861-
input_path=python_script_dir)
866+
input_path=android_src_path)
862867
cover.comment = f"Total number of binaries: {len(final_bin_info)}"
868+
cover.comment += f"\nNotice: {notice_files}"
863869
write_result(result_excel_file, final_bin_info, cover)
864870
result_log["Output FOSSLight Report"] = result_excel_file
865871

0 commit comments

Comments
 (0)