@@ -50,9 +50,10 @@ def main():
50
50
51
51
scanned_result = []
52
52
license_list = []
53
+ time_out = 120
53
54
54
55
try :
55
- opts , args = getopt .getopt (argv , 'hvmjs:p:o:f:' )
56
+ opts , args = getopt .getopt (argv , 'hvmjs:p:o:f:t: ' )
56
57
for opt , arg in opts :
57
58
if opt == "-h" :
58
59
print_help_msg_source ()
@@ -70,6 +71,8 @@ def main():
70
71
format = arg
71
72
elif opt == "-s" :
72
73
selected_scanner = arg .lower ()
74
+ elif opt == "-t" :
75
+ time_out = arg
73
76
except Exception :
74
77
print_help_msg_source ()
75
78
@@ -90,13 +93,15 @@ def main():
90
93
if selected_scanner == 'scancode' :
91
94
success , _result_log ["Scan Result" ], scanned_result , license_list = run_scan (path_to_scan , output_file_name ,
92
95
write_json_file , - 1 , True ,
93
- print_matched_text , format , True )
96
+ print_matched_text , format , True ,
97
+ time_out )
94
98
elif selected_scanner == 'scanoss' :
95
99
scanned_result = run_scanoss_py (path_to_scan , output_file_name , format , True , write_json_file )
96
100
elif selected_scanner == 'all' or selected_scanner == '' :
97
101
success , _result_log ["Scan Result" ], scanned_result , license_list = run_all_scanners (path_to_scan , output_file_name ,
98
102
write_json_file , - 1 ,
99
- print_matched_text , format , True )
103
+ print_matched_text , format , True ,
104
+ time_out )
100
105
else :
101
106
print_help_msg_source ()
102
107
sys .exit (1 )
@@ -167,7 +172,7 @@ def create_report_file(start_time, scanned_result, license_list, selected_scanne
167
172
168
173
169
174
def run_all_scanners (path_to_scan , output_file_name = "" , _write_json_file = False , num_cores = - 1 ,
170
- need_license = False , format = "" , called_by_cli = True ):
175
+ need_license = False , format = "" , called_by_cli = True , time_out = 120 ):
171
176
"""
172
177
Run Scancode and scanoss.py for the given path.
173
178
@@ -192,7 +197,7 @@ def run_all_scanners(path_to_scan, output_file_name="", _write_json_file=False,
192
197
success , _result_log ["Scan Result" ], scancode_result , license_list = run_scan (path_to_scan , output_file_name ,
193
198
_write_json_file , num_cores ,
194
199
True , need_license ,
195
- format , called_by_cli )
200
+ format , called_by_cli , time_out )
196
201
scanoss_result = run_scanoss_py (path_to_scan , output_file_name , format , called_by_cli , _write_json_file )
197
202
198
203
for file_in_scancode_result in scancode_result :
0 commit comments