|
7 | 7 | import shutil |
8 | 8 | import logging |
9 | 9 | import locale |
| 10 | +import re |
10 | 11 | from datetime import datetime |
11 | 12 | from binaryornot.check import is_binary |
12 | 13 | import fosslight_util.constant as constant |
@@ -42,7 +43,8 @@ def find_oss_pkg_info(path): |
42 | 43 | file_abs_path = os.path.join(root, file) |
43 | 44 | file_rel_path = os.path.relpath(file_abs_path, path) |
44 | 45 |
|
45 | | - if file_lower_case in OSS_PKG_INFO_FILES or file_lower_case.startswith("module_license_"): |
| 46 | + if any(re.search(re_oss_pkg_pattern, file_lower_case) for re_oss_pkg_pattern in OSS_PKG_INFO_FILES) \ |
| 47 | + or file_lower_case.startswith("module_license_"): |
46 | 48 | oss_pkg_info.append(file_rel_path) |
47 | 49 | elif is_binary(file_abs_path): |
48 | 50 | DEFAULT_EXCLUDE_EXTENSION_FILES.append(file_rel_path) |
@@ -319,15 +321,14 @@ def run_lint(target_path, disable, output_file_name, format='', need_log_file=Tr |
319 | 321 | lic_present_files_in_yaml = [] |
320 | 322 | cop_present_files_in_yaml = [] |
321 | 323 | excluded_files = [] |
| 324 | + oss_pkg_info = [] |
322 | 325 | _turn_on_default_reuse_config = not disable |
323 | 326 |
|
324 | 327 | if _check_only_file_mode: |
325 | 328 | license_missing_files, copyright_missing_files, project = reuse_for_files(path_to_find, file_to_check_list) |
326 | | - oss_pkg_info = [] |
327 | 329 | else: |
328 | | - license_missing_files, copyright_missing_files, oss_pkg_info, project, |
329 | | - report, excluded_files, lic_present_files_in_yaml, cop_present_files_in_yaml \ |
330 | | - = reuse_for_project(path_to_find) |
| 330 | + license_missing_files, copyright_missing_files, oss_pkg_info, project, \ |
| 331 | + report, excluded_files, lic_present_files_in_yaml, cop_present_files_in_yaml = reuse_for_project(path_to_find) |
331 | 332 |
|
332 | 333 | result_item = result_for_summary(oss_pkg_info, |
333 | 334 | license_missing_files, |
|
0 commit comments