diff --git a/src/fosslight_binary/_simple_mode.py b/src/fosslight_binary/_simple_mode.py index 5426ef3..420ddab 100644 --- a/src/fosslight_binary/_simple_mode.py +++ b/src/fosslight_binary/_simple_mode.py @@ -27,16 +27,10 @@ def exclude_bin_for_simple_mode(binary_list): compressed_list = [] for bin in binary_list: - file_lower_case = bin.bin_name_with_path.lower() - extension = os.path.splitext(file_lower_case)[1][1:].strip() - if is_compressed_file(bin.bin_name_with_path): compressed_list.append(bin.bin_name_with_path) continue - remove_file_ext_list = REMOVE_FILE_EXTENSION_SIMPLE - if any(extension == remove_ext for remove_ext in remove_file_ext_list): - continue if re.search(r".*sources\.jar", bin.bin_name_with_path.lower()) or bin.exclude: continue diff --git a/src/fosslight_binary/binary_analysis.py b/src/fosslight_binary/binary_analysis.py index 6f2f303..43cd73c 100755 --- a/src/fosslight_binary/binary_analysis.py +++ b/src/fosslight_binary/binary_analysis.py @@ -18,7 +18,7 @@ from ._binary_dao import get_oss_info_from_db from ._binary import BinaryItem, TLSH_CHECKSUM_NULL from ._jar_analysis import analyze_jar_file, merge_binary_list -from ._simple_mode import print_simple_mode, filter_binary, init_simple +from ._simple_mode import print_simple_mode, filter_binary, init_simple, REMOVE_FILE_EXTENSION_SIMPLE from fosslight_util.correct import correct_with_yaml from fosslight_util.oss_item import ScannerItem from fosslight_util.exclude import get_excluded_paths @@ -194,10 +194,13 @@ def find_binaries(path_to_find_bin, output_dir, formats, dburl="", simple_mode=F if all_exclude_mode and len(all_exclude_mode) == 4: excluded_path_with_default_exclusion, excluded_path_without_dot, excluded_files, cnt_file_except_skipped = all_exclude_mode + elif simple_mode: + excluded_path_with_default_exclusion, excluded_path_without_dot, excluded_files, cnt_file_except_skipped \ + = get_excluded_paths(path_to_find_bin, path_to_exclude, REMOVE_FILE_EXTENSION_SIMPLE) else: excluded_path_with_default_exclusion, excluded_path_without_dot, excluded_files, cnt_file_except_skipped \ = get_excluded_paths(path_to_find_bin, path_to_exclude) - logger.debug(f"Skipped paths: {excluded_path_with_default_exclusion}") + logger.debug(f"Skipped paths: {excluded_path_with_default_exclusion}") if not os.path.isdir(path_to_find_bin): error_occured(error_msg=f"(-p option) Can't find the directory: {path_to_find_bin}",