Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/fosslight_binary/_simple_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions src/fosslight_binary/binary_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}",
Expand Down