fosslight-scanner 2.1.11__tar.gz → 2.1.13__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.
- {fosslight_scanner-2.1.11/src/fosslight_scanner.egg-info → fosslight_scanner-2.1.13}/PKG-INFO +12 -6
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/README.md +7 -1
- fosslight_scanner-2.1.13/requirements.txt +11 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/setup.py +1 -1
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/_help.py +3 -1
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/fosslight_scanner.py +56 -12
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13/src/fosslight_scanner.egg-info}/PKG-INFO +12 -6
- fosslight_scanner-2.1.13/src/fosslight_scanner.egg-info/requires.txt +11 -0
- fosslight_scanner-2.1.11/requirements.txt +0 -11
- fosslight_scanner-2.1.11/src/fosslight_scanner.egg-info/requires.txt +0 -11
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/LICENSE +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/MANIFEST.in +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/setup.cfg +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/__init__.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/_get_input.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/_parse_setting.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/_run_compare.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/cli.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/common.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/resources/bom_compare.html +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner.egg-info/SOURCES.txt +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner.egg-info/dependency_links.txt +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner.egg-info/entry_points.txt +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner.egg-info/top_level.txt +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test__get_input.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test__help.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test__parse_setting.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test__run_compare.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test_cli.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test_common.py +0 -0
- {fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/tests/test_fosslight_scanner.py +0 -0
{fosslight_scanner-2.1.11/src/fosslight_scanner.egg-info → fosslight_scanner-2.1.13}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_scanner
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.13
|
|
4
4
|
Summary: FOSSLight Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_scanner
|
|
@@ -20,10 +20,10 @@ Requires-Dist: openpyxl
|
|
|
20
20
|
Requires-Dist: progress
|
|
21
21
|
Requires-Dist: pyyaml
|
|
22
22
|
Requires-Dist: beautifulsoup4
|
|
23
|
-
Requires-Dist: fosslight_util<3.0.0,>=2.1.
|
|
24
|
-
Requires-Dist: fosslight_source<3.0.0,>=2.
|
|
25
|
-
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.
|
|
26
|
-
Requires-Dist: fosslight_binary<6.0.0,>=5.1.
|
|
23
|
+
Requires-Dist: fosslight_util<3.0.0,>=2.1.37
|
|
24
|
+
Requires-Dist: fosslight_source<3.0.0,>=2.2.3
|
|
25
|
+
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.29
|
|
26
|
+
Requires-Dist: fosslight_binary<6.0.0,>=5.1.17
|
|
27
27
|
Requires-Dist: fosslight_prechecker<5.0.0,>=4.0.0
|
|
28
28
|
Dynamic: author
|
|
29
29
|
Dynamic: classifier
|
|
@@ -119,7 +119,9 @@ Options:
|
|
|
119
119
|
* Compare mode result file: supports excel, json, yaml, html
|
|
120
120
|
-o <output> Output directory or file
|
|
121
121
|
-c <number> Number of processes to analyze source
|
|
122
|
-
-e <path> Path to exclude from analysis (
|
|
122
|
+
-e <path> Path to exclude from analysis (files and directories, pattern matching is available
|
|
123
|
+
* IMPORTANT: Always wrap patterns in quotes("") to avoid shell expansion.
|
|
124
|
+
Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
123
125
|
-r Keep raw data
|
|
124
126
|
-t Hide the progress bar
|
|
125
127
|
-v Print FOSSLight Scanner version
|
|
@@ -130,6 +132,10 @@ Options:
|
|
|
130
132
|
- Refs.
|
|
131
133
|
- Additional arguments for running dependency analysis. See the [FOSSLight Dependency Guide][fd_guide] for instructions.
|
|
132
134
|
- In the case of DB URL, it is the [DB connection information to be used in FOSSLight Binary][flbindb].
|
|
135
|
+
- Pattern Matching Pattern matching guide Guide for the -e Option
|
|
136
|
+
- ⚠️ Make sure to use double quotes ("") when entering values.
|
|
137
|
+
- Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
138
|
+
- ⚠️ File names and extensions are case-sensitive, so please enter them exactly as intended.
|
|
133
139
|
|
|
134
140
|
[flbindb]: https://fosslight.org/fosslight-guide-en/scanner/etc/binary_db.html
|
|
135
141
|
[fd_guide]: https://fosslight.org/fosslight-guide-en/scanner/2_dependency.html
|
|
@@ -80,7 +80,9 @@ Options:
|
|
|
80
80
|
* Compare mode result file: supports excel, json, yaml, html
|
|
81
81
|
-o <output> Output directory or file
|
|
82
82
|
-c <number> Number of processes to analyze source
|
|
83
|
-
-e <path> Path to exclude from analysis (
|
|
83
|
+
-e <path> Path to exclude from analysis (files and directories, pattern matching is available
|
|
84
|
+
* IMPORTANT: Always wrap patterns in quotes("") to avoid shell expansion.
|
|
85
|
+
Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
84
86
|
-r Keep raw data
|
|
85
87
|
-t Hide the progress bar
|
|
86
88
|
-v Print FOSSLight Scanner version
|
|
@@ -91,6 +93,10 @@ Options:
|
|
|
91
93
|
- Refs.
|
|
92
94
|
- Additional arguments for running dependency analysis. See the [FOSSLight Dependency Guide][fd_guide] for instructions.
|
|
93
95
|
- In the case of DB URL, it is the [DB connection information to be used in FOSSLight Binary][flbindb].
|
|
96
|
+
- Pattern Matching Pattern matching guide Guide for the -e Option
|
|
97
|
+
- ⚠️ Make sure to use double quotes ("") when entering values.
|
|
98
|
+
- Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
99
|
+
- ⚠️ File names and extensions are case-sensitive, so please enter them exactly as intended.
|
|
94
100
|
|
|
95
101
|
[flbindb]: https://fosslight.org/fosslight-guide-en/scanner/etc/binary_db.html
|
|
96
102
|
[fd_guide]: https://fosslight.org/fosslight-guide-en/scanner/2_dependency.html
|
|
@@ -15,7 +15,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
|
|
|
15
15
|
if __name__ == "__main__":
|
|
16
16
|
setup(
|
|
17
17
|
name='fosslight_scanner',
|
|
18
|
-
version='2.1.
|
|
18
|
+
version='2.1.13',
|
|
19
19
|
package_dir={"": "src"},
|
|
20
20
|
packages=find_packages(where='src'),
|
|
21
21
|
description='FOSSLight Scanner',
|
|
@@ -29,7 +29,9 @@ _HELP_MESSAGE_SCANNER = f"""
|
|
|
29
29
|
-f <formats> [<format> ...]\t FOSSLight Report file format ({', '.join(SUPPORT_FORMAT)})
|
|
30
30
|
* Compare mode result file: supports excel, json, yaml, html
|
|
31
31
|
* Multiple formats can be specified separated by space.
|
|
32
|
-
-e <path>\t\t Path to exclude from analysis (
|
|
32
|
+
-e <path>\t\t Path to exclude from analysis (files and directories)
|
|
33
|
+
* IMPORTANT: Always wrap patterns in double quotes ("") to avoid shell expansion.
|
|
34
|
+
Example) fosslight -e "test/abc.py" "*.jar"
|
|
33
35
|
-o <output>\t\t Output directory or file
|
|
34
36
|
-c <number>\t\t Number of processes to analyze source
|
|
35
37
|
-r\t\t\t Keep raw data
|
{fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/fosslight_scanner.py
RENAMED
|
@@ -28,6 +28,7 @@ from fosslight_util.output_format import check_output_formats_v2
|
|
|
28
28
|
from fosslight_util.cover import CoverItem
|
|
29
29
|
from fosslight_util.oss_item import ScannerItem
|
|
30
30
|
from fosslight_util.output_format import write_output_file
|
|
31
|
+
from fosslight_util.exclude import get_excluded_paths
|
|
31
32
|
|
|
32
33
|
from .common import (
|
|
33
34
|
call_analysis_api, update_oss_item,
|
|
@@ -46,7 +47,7 @@ COMPARE_OUTPUT_REPORT_PREFIX = "fosslight_compare_"
|
|
|
46
47
|
PKG_NAME = "fosslight_scanner"
|
|
47
48
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
|
48
49
|
warnings.simplefilter(action='ignore', category=FutureWarning)
|
|
49
|
-
_output_dir = "fosslight_raw_data"
|
|
50
|
+
_output_dir = ".fosslight_raw_data"
|
|
50
51
|
_log_file = "fosslight_log_all_"
|
|
51
52
|
_start_time = ""
|
|
52
53
|
_executed_path = ""
|
|
@@ -181,6 +182,10 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
181
182
|
if not correct_fpath:
|
|
182
183
|
correct_fpath = src_path
|
|
183
184
|
|
|
185
|
+
excluded_path_with_default_exclusion, excluded_path_without_dot, excluded_files, cnt_file_except_skipped = (
|
|
186
|
+
get_excluded_paths(src_path, path_to_exclude))
|
|
187
|
+
logger.debug(f"Skipped paths: {excluded_path_with_default_exclusion}")
|
|
188
|
+
|
|
184
189
|
try:
|
|
185
190
|
final_excel_dir = os.path.abspath(final_excel_dir)
|
|
186
191
|
abs_path = os.path.abspath(src_path)
|
|
@@ -203,7 +208,10 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
203
208
|
source_write_json_file=source_write_json_file,
|
|
204
209
|
source_print_matched_text=source_print_matched_text,
|
|
205
210
|
source_time_out=source_time_out,
|
|
206
|
-
formats=formats
|
|
211
|
+
formats=formats,
|
|
212
|
+
all_exclude_mode=(excluded_path_with_default_exclusion,
|
|
213
|
+
excluded_path_without_dot,
|
|
214
|
+
excluded_files, cnt_file_except_skipped)
|
|
207
215
|
)
|
|
208
216
|
if success:
|
|
209
217
|
all_scan_item.file_items.update(result[2].file_items)
|
|
@@ -228,7 +236,11 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
228
236
|
_output_dir,
|
|
229
237
|
formats, db_url, binary_simple,
|
|
230
238
|
correct_mode, correct_fpath,
|
|
231
|
-
path_to_exclude=path_to_exclude
|
|
239
|
+
path_to_exclude=path_to_exclude,
|
|
240
|
+
all_exclude_mode=(excluded_path_with_default_exclusion,
|
|
241
|
+
excluded_path_without_dot,
|
|
242
|
+
excluded_files,
|
|
243
|
+
cnt_file_except_skipped))
|
|
232
244
|
if success:
|
|
233
245
|
all_scan_item.file_items.update(result.file_items)
|
|
234
246
|
all_cover_items.append(result.cover)
|
|
@@ -236,7 +248,10 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
236
248
|
if run_dep:
|
|
237
249
|
dep_scanitem = run_dependency(src_path, _output_dir,
|
|
238
250
|
dep_arguments, path_to_exclude, formats,
|
|
239
|
-
recursive_dep
|
|
251
|
+
recursive_dep,
|
|
252
|
+
all_exclude_mode=(excluded_path_with_default_exclusion,
|
|
253
|
+
excluded_path_without_dot,
|
|
254
|
+
excluded_files, cnt_file_except_skipped))
|
|
240
255
|
all_scan_item.file_items.update(dep_scanitem.file_items)
|
|
241
256
|
all_cover_items.append(dep_scanitem.cover)
|
|
242
257
|
else:
|
|
@@ -249,7 +264,7 @@ def run_scanner(src_path, dep_arguments, output_path, keep_raw_data=False,
|
|
|
249
264
|
cover = CoverItem(tool_name=PKG_NAME,
|
|
250
265
|
start_time=_start_time,
|
|
251
266
|
input_path=abs_path,
|
|
252
|
-
exclude_path=
|
|
267
|
+
exclude_path=excluded_path_without_dot,
|
|
253
268
|
simple_mode=False)
|
|
254
269
|
merge_comment = []
|
|
255
270
|
for ci in all_cover_items:
|
|
@@ -335,6 +350,38 @@ def download_source(link, out_dir):
|
|
|
335
350
|
return success, temp_src_dir, oss_name, oss_version
|
|
336
351
|
|
|
337
352
|
|
|
353
|
+
def rename_and_remove_hidden_folder(output_path, output_dir, keep_raw_data=False):
|
|
354
|
+
try:
|
|
355
|
+
hidden_log_dir = os.path.join(output_path, ".fosslight_log")
|
|
356
|
+
visible_log_dir = os.path.join(output_path, "fosslight_log")
|
|
357
|
+
if os.path.exists(hidden_log_dir):
|
|
358
|
+
try:
|
|
359
|
+
if os.path.exists(visible_log_dir):
|
|
360
|
+
shutil.rmtree(visible_log_dir)
|
|
361
|
+
shutil.move(hidden_log_dir, visible_log_dir)
|
|
362
|
+
except Exception as ex:
|
|
363
|
+
logger.debug(f"Error renaming log folder: {ex}")
|
|
364
|
+
|
|
365
|
+
if keep_raw_data:
|
|
366
|
+
visible_raw_dir = os.path.join(os.path.dirname(output_dir), "fosslight_raw_data")
|
|
367
|
+
if os.path.exists(output_dir):
|
|
368
|
+
if os.path.exists(visible_raw_dir):
|
|
369
|
+
shutil.rmtree(visible_raw_dir)
|
|
370
|
+
shutil.move(output_dir, visible_raw_dir)
|
|
371
|
+
logger.debug(f"Renamed {output_dir} to {visible_raw_dir}")
|
|
372
|
+
else:
|
|
373
|
+
logger.debug(f"Remove temporary files: {output_dir}")
|
|
374
|
+
if os.path.exists(output_dir):
|
|
375
|
+
shutil.rmtree(output_dir)
|
|
376
|
+
|
|
377
|
+
visible_raw_dir = os.path.join(os.path.dirname(output_dir), "fosslight_raw_data")
|
|
378
|
+
if os.path.exists(visible_raw_dir):
|
|
379
|
+
shutil.rmtree(visible_raw_dir)
|
|
380
|
+
logger.debug(f"Removed previous raw data folder: {visible_raw_dir}")
|
|
381
|
+
except Exception as ex:
|
|
382
|
+
logger.debug(f"Error cleaning up output directories: {ex}")
|
|
383
|
+
|
|
384
|
+
|
|
338
385
|
def init(output_path="", make_outdir=True):
|
|
339
386
|
global _output_dir, _log_file, _start_time, logger
|
|
340
387
|
|
|
@@ -352,7 +399,7 @@ def init(output_path="", make_outdir=True):
|
|
|
352
399
|
Path(_output_dir).mkdir(parents=True, exist_ok=True)
|
|
353
400
|
_output_dir = os.path.abspath(_output_dir)
|
|
354
401
|
|
|
355
|
-
log_dir = os.path.join(output_root_dir, "fosslight_log")
|
|
402
|
+
log_dir = os.path.join(output_root_dir, ".fosslight_log")
|
|
356
403
|
logger, result_log = init_log(os.path.join(log_dir, f"{_log_file}{_start_time}.txt"),
|
|
357
404
|
True, logging.INFO, logging.DEBUG, PKG_NAME)
|
|
358
405
|
|
|
@@ -480,12 +527,9 @@ def run_main(mode_list, path_arg, dep_arguments, output_file_or_dir, file_format
|
|
|
480
527
|
shutil.rmtree(extract_folder)
|
|
481
528
|
else:
|
|
482
529
|
logger.error("(mode) No mode has been selected for analysis.")
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
shutil.rmtree(_output_dir)
|
|
487
|
-
except Exception as ex:
|
|
488
|
-
logger.debug(f"Error to remove temp files:{ex}")
|
|
530
|
+
|
|
531
|
+
rename_and_remove_hidden_folder(output_path, _output_dir, keep_raw_data)
|
|
532
|
+
|
|
489
533
|
except Exception as ex:
|
|
490
534
|
logger.warning(str(ex))
|
|
491
535
|
return False
|
{fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13/src/fosslight_scanner.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_scanner
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.13
|
|
4
4
|
Summary: FOSSLight Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_scanner
|
|
@@ -20,10 +20,10 @@ Requires-Dist: openpyxl
|
|
|
20
20
|
Requires-Dist: progress
|
|
21
21
|
Requires-Dist: pyyaml
|
|
22
22
|
Requires-Dist: beautifulsoup4
|
|
23
|
-
Requires-Dist: fosslight_util<3.0.0,>=2.1.
|
|
24
|
-
Requires-Dist: fosslight_source<3.0.0,>=2.
|
|
25
|
-
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.
|
|
26
|
-
Requires-Dist: fosslight_binary<6.0.0,>=5.1.
|
|
23
|
+
Requires-Dist: fosslight_util<3.0.0,>=2.1.37
|
|
24
|
+
Requires-Dist: fosslight_source<3.0.0,>=2.2.3
|
|
25
|
+
Requires-Dist: fosslight_dependency<5.0.0,>=4.1.29
|
|
26
|
+
Requires-Dist: fosslight_binary<6.0.0,>=5.1.17
|
|
27
27
|
Requires-Dist: fosslight_prechecker<5.0.0,>=4.0.0
|
|
28
28
|
Dynamic: author
|
|
29
29
|
Dynamic: classifier
|
|
@@ -119,7 +119,9 @@ Options:
|
|
|
119
119
|
* Compare mode result file: supports excel, json, yaml, html
|
|
120
120
|
-o <output> Output directory or file
|
|
121
121
|
-c <number> Number of processes to analyze source
|
|
122
|
-
-e <path> Path to exclude from analysis (
|
|
122
|
+
-e <path> Path to exclude from analysis (files and directories, pattern matching is available
|
|
123
|
+
* IMPORTANT: Always wrap patterns in quotes("") to avoid shell expansion.
|
|
124
|
+
Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
123
125
|
-r Keep raw data
|
|
124
126
|
-t Hide the progress bar
|
|
125
127
|
-v Print FOSSLight Scanner version
|
|
@@ -130,6 +132,10 @@ Options:
|
|
|
130
132
|
- Refs.
|
|
131
133
|
- Additional arguments for running dependency analysis. See the [FOSSLight Dependency Guide][fd_guide] for instructions.
|
|
132
134
|
- In the case of DB URL, it is the [DB connection information to be used in FOSSLight Binary][flbindb].
|
|
135
|
+
- Pattern Matching Pattern matching guide Guide for the -e Option
|
|
136
|
+
- ⚠️ Make sure to use double quotes ("") when entering values.
|
|
137
|
+
- Example) fosslight -e "test/abc.py" "*.jar" "test/"
|
|
138
|
+
- ⚠️ File names and extensions are case-sensitive, so please enter them exactly as intended.
|
|
133
139
|
|
|
134
140
|
[flbindb]: https://fosslight.org/fosslight-guide-en/scanner/etc/binary_db.html
|
|
135
141
|
[fd_guide]: https://fosslight.org/fosslight-guide-en/scanner/2_dependency.html
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner/_parse_setting.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_scanner-2.1.11 → fosslight_scanner-2.1.13}/src/fosslight_scanner.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|