Skip to content

Commit bb42c9a

Browse files
committed
Add the option for correction with sbom-info.yaml
2 parents f1288cc + f0a04aa commit bb42c9a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pyparsing<=3.0.4;python_full_version<"3.6.8"
2-
scancode-toolkit
2+
scancode-toolkit==31.2.6
33
XlsxWriter
44
typecode-libmagic
5-
fosslight_util>=1.4.0
5+
fosslight_util>=1.4.24
66
PyYAML
77
wheel

src/fosslight_source/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def main():
5151
correct_mode = True
5252
correct_filepath = os.getcwd()
5353

54-
5554
scanned_result = []
5655
license_list = []
5756
time_out = 120
@@ -131,7 +130,7 @@ def main():
131130
print_help_msg_source_scanner()
132131
sys.exit(1)
133132
create_report_file(_start_time, scanned_result, license_list, selected_scanner, print_matched_text,
134-
output_path, output_file, output_extension, correct_mode, correct_filepath)
133+
output_path, output_file, output_extension, correct_mode, correct_filepath, path_to_scan)
135134
try:
136135
logger.info(yaml.safe_dump(_result_log, allow_unicode=True, sort_keys=True))
137136
except Exception as ex:
@@ -142,7 +141,8 @@ def main():
142141

143142

144143
def create_report_file(_start_time, scanned_result, license_list, selected_scanner, need_license=False,
145-
output_path="", output_file="", output_extension="", correct_mode=True, correct_filepath=""):
144+
output_path="", output_file="", output_extension="", correct_mode=True, correct_filepath="",
145+
path_to_scan=""):
146146
"""
147147
Create report files for given scanned result.
148148
@@ -190,7 +190,7 @@ def create_report_file(_start_time, scanned_result, license_list, selected_scann
190190
sheet_list["scanoss_reference"] = get_scanoss_extra_info(scanned_result)
191191

192192
if correct_mode:
193-
success, msg_correct, correct_list = correct_with_yaml(correct_filepath, sheet_list)
193+
success, msg_correct, correct_list = correct_with_yaml(correct_filepath, path_to_scan, sheet_list)
194194
if not success:
195195
logger.info(f"No correction with yaml: {msg_correct}")
196196
else:

src/fosslight_source/run_scancode.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ def run_scan(path_to_scan, output_file_name="",
102102
output_file_without_ext = os.path.join(output_path, output_file)
103103
if not called_by_cli:
104104
if correct_mode:
105-
success, msg_correct, correct_list = correct_with_yaml(correct_filepath, sheet_list)
105+
success, msg_correct, correct_list = correct_with_yaml(correct_filepath,
106+
path_to_scan, sheet_list)
106107
if not success:
107108
logger.info(f"No correction with yaml: {msg_correct}")
108109
else:

0 commit comments

Comments
 (0)