Skip to content

Commit 1da18a3

Browse files
committed
Print even files that were not detected
1 parent 205d0a0 commit 1da18a3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ openpyxl
55
progress
66
pyyaml
77
beautifulsoup4
8-
fosslight_util>=1.4.29
8+
fosslight_util>=1.4.32
99
fosslight_source==1.7.0
1010
fosslight_dependency>=3.7.4
1111
fosslight_binary>=4.1.24

src/fosslight_scanner/common.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from fosslight_util.read_excel import read_oss_report
1919
from fosslight_util.output_format import write_output_file
2020
from pathlib import Path
21+
from fosslight_util.oss_item import OssItem
2122

2223
logger = logging.getLogger(constant.LOGGER_NAME)
2324
SRC_SHEET = 'SRC_FL_Source'
@@ -218,9 +219,19 @@ def create_scancodejson(final_report, output_extension, ui_mode_report, src_path
218219
root_dir = ""
219220

220221
try:
222+
item_without_oss = OssItem("")
221223
oss_total_list = get_osslist(os.path.dirname(final_report), os.path.basename(final_report),
222224
output_extension, '')
223-
225+
if src_path:
226+
for root, dirs, files in os.walk(src_path):
227+
for file in files:
228+
item_path = os.path.join(root, file)
229+
item_path = item_path.replace(parent + os.path.sep, '', 1)
230+
included = any(item_path in x.source_name_or_path for x in oss_total_list)
231+
if not included:
232+
item_without_oss.source_name_or_path = item_path
233+
if len(item_without_oss.source_name_or_path) > 0:
234+
oss_total_list.append(item_without_oss)
224235
if root_dir:
225236
for oss in oss_total_list:
226237
tmp_path_list = oss.source_name_or_path

0 commit comments

Comments
 (0)