fosslight-binary 5.1.1__tar.gz → 5.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/PKG-INFO +1 -1
  2. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/requirements.txt +2 -2
  3. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/setup.py +1 -1
  4. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/binary_analysis.py +10 -8
  5. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/cli.py +22 -2
  6. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary.egg-info/PKG-INFO +1 -1
  7. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary.egg-info/requires.txt +2 -2
  8. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/LICENSE +0 -0
  9. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/LICENSES/Apache-2.0.txt +0 -0
  10. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/LICENSES/LicenseRef-3rd_party_licenses.txt +0 -0
  11. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/MANIFEST.in +0 -0
  12. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/README.md +0 -0
  13. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/setup.cfg +0 -0
  14. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/__init__.py +0 -0
  15. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/_binary.py +0 -0
  16. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/_binary_dao.py +0 -0
  17. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/_help.py +0 -0
  18. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/_jar_analysis.py +0 -0
  19. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary/_simple_mode.py +0 -0
  20. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary.egg-info/SOURCES.txt +0 -0
  21. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary.egg-info/dependency_links.txt +0 -0
  22. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary.egg-info/entry_points.txt +0 -0
  23. {fosslight_binary-5.1.1 → fosslight_binary-5.1.2}/src/fosslight_binary.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight_binary
3
- Version: 5.1.1
3
+ Version: 5.1.2
4
4
  Summary: FOSSLight Binary Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_binary_scanner
6
6
  Author: LG Electronics
@@ -2,11 +2,11 @@ binaryornot
2
2
  numpy
3
3
  pandas
4
4
  parmap
5
- psycopg2-binary
5
+ psycopg2-binary==2.9.9
6
6
  python-dateutil
7
7
  py-tlsh
8
8
  pytz
9
9
  XlsxWriter
10
10
  PyYAML
11
- fosslight_util>=2.1.0
11
+ fosslight_util>=2.1.6
12
12
  dependency-check
@@ -33,7 +33,7 @@ if __name__ == "__main__":
33
33
 
34
34
  setup(
35
35
  name=_PACKAEG_NAME,
36
- version='5.1.1',
36
+ version='5.1.2',
37
37
  package_dir={"": "src"},
38
38
  packages=find_packages(where='src'),
39
39
  description='FOSSLight Binary Scanner',
@@ -90,12 +90,15 @@ def init(path_to_find_bin, output_file_name, formats, path_to_exclude=[]):
90
90
  for i, output_extension in enumerate(output_extensions):
91
91
  if output_files[i] is None or output_files[i] == "":
92
92
  if formats:
93
- if formats[i].startswith('spdx'):
94
- if platform.system() != 'Windows':
95
- output_files[i] = f"fosslight_spdx_bin_{start_time}"
96
- else:
97
- logger.warning('spdx format is not supported on Windows. Please remove spdx from format.')
93
+ if formats[i].startswith('spdx') or formats[i].startswith('cyclonedx'):
94
+ if platform.system() == 'Windows':
95
+ logger.warning(f'{formats[i]} is not supported on Windows. Please remove {formats[i]} from format.')
98
96
  to_remove.append(i)
97
+ else:
98
+ if formats[i].startswith('spdx'):
99
+ output_files[i] = f"fosslight_spdx_bin_{start_time}"
100
+ elif formats[i].startswith('cyclonedx'):
101
+ output_files[i] = f'fosslight_cyclonedx_bin_{start_time}'
99
102
  else:
100
103
  if output_extension == _json_ext:
101
104
  output_files[i] = f"fosslight_opossum_bin_{start_time}"
@@ -200,12 +203,11 @@ def find_binaries(path_to_find_bin, output_dir, formats, dburl="", simple_mode=F
200
203
  writing_msg = ""
201
204
  results = []
202
205
  bin_list = []
203
- base_dir_name = os.path.basename(path_to_find_bin)
204
206
  scan_item = ScannerItem(PKG_NAME, "")
205
- abs_path_to_exclude = [os.path.abspath(os.path.join(base_dir_name, path)) for path in path_to_exclude if path.strip() != ""]
207
+ abs_path_to_exclude = [os.path.abspath(path) for path in path_to_exclude if path.strip() != ""]
206
208
 
207
209
  if not os.path.isdir(path_to_find_bin):
208
- error_occured(error_msg=f"Can't find the directory : {path_to_find_bin}",
210
+ error_occured(error_msg=f"(-p option) Can't find the directory: {path_to_find_bin}",
209
211
  result_log=_result_log,
210
212
  exit=True,
211
213
  mode=mode)
@@ -5,6 +5,7 @@
5
5
  import argparse
6
6
  import sys
7
7
  import os
8
+ import shutil
8
9
  from fosslight_util.help import print_package_version
9
10
  from fosslight_binary._help import print_help_msg
10
11
  from fosslight_binary.binary_analysis import find_binaries
@@ -13,6 +14,23 @@ from fosslight_util.timer_thread import TimerThread
13
14
  _PKG_NAME = "fosslight_binary"
14
15
 
15
16
 
17
+ def get_terminal_size():
18
+ size = shutil.get_terminal_size()
19
+ return size.lines
20
+
21
+
22
+ def paginate_file(file_path):
23
+ lines_per_page = get_terminal_size() - 1
24
+ with open(file_path, 'r', encoding='utf8') as file:
25
+ lines = file.readlines()
26
+
27
+ for i in range(0, len(lines), lines_per_page):
28
+ os.system('clear' if os.name == 'posix' else 'cls')
29
+ print(''.join(lines[i: i + lines_per_page]))
30
+ if i + lines_per_page < len(lines):
31
+ input("Press Enter to see the next page...")
32
+
33
+
16
34
  def main():
17
35
  global windows
18
36
  path_to_find_bin = ""
@@ -85,8 +103,10 @@ def main():
85
103
  data_path = os.path.join(base_path, 'LICENSES')
86
104
  print(f"*** {_PKG_NAME} open source license notice ***")
87
105
  for ff in os.listdir(data_path):
88
- f = open(os.path.join(data_path, ff), 'r', encoding='utf8')
89
- print(f.read())
106
+ source_file = os.path.join(data_path, ff)
107
+ destination_file = os.path.join(base_path, ff)
108
+ paginate_file(source_file)
109
+ shutil.copyfile(source_file, destination_file)
90
110
  sys.exit(0)
91
111
 
92
112
  timer = TimerThread()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight-binary
3
- Version: 5.1.1
3
+ Version: 5.1.2
4
4
  Summary: FOSSLight Binary Scanner
5
5
  Home-page: https://github.com/fosslight/fosslight_binary_scanner
6
6
  Author: LG Electronics
@@ -2,13 +2,13 @@ binaryornot
2
2
  numpy
3
3
  pandas
4
4
  parmap
5
- psycopg2-binary
5
+ psycopg2-binary==2.9.9
6
6
  python-dateutil
7
7
  py-tlsh
8
8
  pytz
9
9
  XlsxWriter
10
10
  PyYAML
11
- fosslight_util>=2.1.0
11
+ fosslight_util>=2.1.6
12
12
  dependency-check
13
13
 
14
14
  [:"darwin" in sys_platform]