1 |
commit: f8360d99befc33909d0769464c209806777e7db2 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 10 20:27:45 2014 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Feb 11 08:07:35 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=f8360d99 |
7 |
|
8 |
revdep_rebuild: Remove duplicate files for the scanelf checks. |
9 |
|
10 |
Convert the file lists to a set to remove teh duplicates. This can reduce the number of files to nealry half. |
11 |
Convert it back to a list for the scanelf loop for easier batch processing. |
12 |
|
13 |
--- |
14 |
pym/gentoolkit/revdep_rebuild/analyse.py | 2 +- |
15 |
pym/gentoolkit/revdep_rebuild/stuff.py | 8 ++++++-- |
16 |
2 files changed, 7 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py |
19 |
index 6ef4d90..9cee906 100644 |
20 |
--- a/pym/gentoolkit/revdep_rebuild/analyse.py |
21 |
+++ b/pym/gentoolkit/revdep_rebuild/analyse.py |
22 |
@@ -256,7 +256,7 @@ def analyse(settings, logger, libraries=None, la_libraries=None, |
23 |
) |
24 |
logger.info(green(' * ') + bold('Scanning files')) |
25 |
|
26 |
- libs_and_bins = libraries+binaries |
27 |
+ libs_and_bins = set(libraries + binaries) |
28 |
|
29 |
scanned_files = scan_files(libs_and_bins, settings['CMD_MAX_ARGS']) |
30 |
|
31 |
|
32 |
diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py |
33 |
index ea27ef2..817396e 100644 |
34 |
--- a/pym/gentoolkit/revdep_rebuild/stuff.py |
35 |
+++ b/pym/gentoolkit/revdep_rebuild/stuff.py |
36 |
@@ -36,13 +36,17 @@ def scan(params, files, max_args): |
37 |
|
38 |
@return scanelf output (joined if was called several times) |
39 |
''' |
40 |
+ print("SCAN(), params = ", params, len(files)) |
41 |
+ # change it to a sorted list for group processing |
42 |
+ _files = list(files) |
43 |
out = [] |
44 |
- for i in range(0, len(files), max_args): |
45 |
+ for i in range(0, len(_files), max_args): |
46 |
output = call_program( |
47 |
- ['scanelf'] + params + files[i:i+max_args]).strip().split('\n') |
48 |
+ ['scanelf'] + params + _files[i:i+max_args]).strip().split('\n') |
49 |
output = [x for x in output if x != ''] |
50 |
if output: |
51 |
out.extend(output) |
52 |
+ print("SCAN(), final output length:", len(out)) |
53 |
return out |