File tree Expand file tree Collapse file tree 5 files changed +22
-23
lines changed Expand file tree Collapse file tree 5 files changed +22
-23
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ v33.2.0 (unreleased)
38
38
unit paths when available from elfs.
39
39
https://github.com/nexB/purldb/issues/260
40
40
41
+ - Extract all archives recursively in the `scan_single_package ` pipeline.
42
+ https://github.com/nexB/scancode.io/issues/1081
43
+
41
44
v33.1.0 (2024-02-02)
42
45
--------------------
43
46
Original file line number Diff line number Diff line change @@ -248,6 +248,18 @@ def flag_ignored_resources(self):
248
248
if ignored_patterns := self .env .get ("ignored_patterns" ):
249
249
flag .flag_ignored_patterns (self .project , patterns = ignored_patterns )
250
250
251
+ def extract_archives (self ):
252
+ """Extract archives located in the codebase/ directory with extractcode."""
253
+ from scanpipe .pipes import scancode
254
+
255
+ extract_errors = scancode .extract_archives (
256
+ location = self .project .codebase_path ,
257
+ recurse = self .env .get ("extract_recursively" , True ),
258
+ )
259
+
260
+ if extract_errors :
261
+ self .add_error ("\n " .join (extract_errors ))
262
+
251
263
252
264
def is_pipeline (obj ):
253
265
"""
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ def steps(cls):
57
57
return (
58
58
cls .get_inputs ,
59
59
cls .extract_inputs_to_codebase_directory ,
60
- cls .extract_archives_in_place ,
60
+ cls .extract_archives ,
61
61
cls .collect_and_create_codebase_resources ,
62
62
cls .fingerprint_codebase_directories ,
63
63
cls .flag_empty_files ,
@@ -133,16 +133,6 @@ def extract_inputs_to_codebase_directory(self):
133
133
if errors :
134
134
self .add_error ("\n " .join (errors ))
135
135
136
- def extract_archives_in_place (self ):
137
- """Extract recursively from* and to* archives in place with extractcode."""
138
- extract_errors = scancode .extract_archives (
139
- self .project .codebase_path ,
140
- recurse = self .env .get ("extract_recursively" , True ),
141
- )
142
-
143
- if extract_errors :
144
- self .add_error ("\n " .join (extract_errors ))
145
-
146
136
def collect_and_create_codebase_resources (self ):
147
137
"""Collect and create codebase resources."""
148
138
pipes .collect_and_create_codebase_resources (self .project )
Original file line number Diff line number Diff line change @@ -54,16 +54,6 @@ def copy_inputs_to_codebase_directory(self):
54
54
"""
55
55
copy_inputs (self .project .inputs (), self .project .codebase_path )
56
56
57
- def extract_archives (self ):
58
- """Extract archives with extractcode."""
59
- extract_errors = scancode .extract_archives (
60
- location = self .project .codebase_path ,
61
- recurse = self .env .get ("extract_recursively" , True ),
62
- )
63
-
64
- if extract_errors :
65
- self .add_error ("\n " .join (extract_errors ))
66
-
67
57
def collect_and_create_codebase_resources (self ):
68
58
"""Collect and create codebase resources."""
69
59
pipes .collect_and_create_codebase_resources (self .project )
Original file line number Diff line number Diff line change 31
31
from scanpipe .pipes import scancode
32
32
from scanpipe .pipes .input import copy_input
33
33
from scanpipe .pipes .input import is_archive
34
- from scanpipe .pipes .scancode import extract_archive
35
34
36
35
37
36
class ScanSinglePackage (Pipeline ):
@@ -50,6 +49,7 @@ def steps(cls):
50
49
cls .get_package_input ,
51
50
cls .collect_input_information ,
52
51
cls .extract_input_to_codebase_directory ,
52
+ cls .extract_archives ,
53
53
cls .run_scan ,
54
54
cls .load_inventory_from_toolkit_scan ,
55
55
cls .make_summary_from_scan_results ,
@@ -93,7 +93,11 @@ def extract_input_to_codebase_directory(self):
93
93
copy_input (self .input_path , self .project .codebase_path )
94
94
return
95
95
96
- extract_errors = extract_archive (self .input_path , self .project .codebase_path )
96
+ extract_errors = scancode .extract_archive (
97
+ location = self .input_path ,
98
+ target = self .project .codebase_path ,
99
+ )
100
+
97
101
if extract_errors :
98
102
self .add_error ("\n " .join (extract_errors ))
99
103
You can’t perform that action at this time.
0 commit comments