From f8360d99befc33909d0769464c209806777e7db2 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Mon, 10 Feb 2014 12:27:45 -0800 Subject: revdep_rebuild: Remove duplicate files for the scanelf checks. Convert the file lists to a set to remove teh duplicates. This can reduce the number of files to nealry half. Convert it back to a list for the scanelf loop for easier batch processing. --- pym/gentoolkit/revdep_rebuild/analyse.py | 2 +- pym/gentoolkit/revdep_rebuild/stuff.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py index 6ef4d90..9cee906 100644 --- a/pym/gentoolkit/revdep_rebuild/analyse.py +++ b/pym/gentoolkit/revdep_rebuild/analyse.py @@ -256,7 +256,7 @@ def analyse(settings, logger, libraries=None, la_libraries=None, ) logger.info(green(' * ') + bold('Scanning files')) - libs_and_bins = libraries+binaries + libs_and_bins = set(libraries + binaries) scanned_files = scan_files(libs_and_bins, settings['CMD_MAX_ARGS']) diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py index ea27ef2..817396e 100644 --- a/pym/gentoolkit/revdep_rebuild/stuff.py +++ b/pym/gentoolkit/revdep_rebuild/stuff.py @@ -36,13 +36,17 @@ def scan(params, files, max_args): @return scanelf output (joined if was called several times) ''' + print("SCAN(), params = ", params, len(files)) + # change it to a sorted list for group processing + _files = list(files) out = [] - for i in range(0, len(files), max_args): + for i in range(0, len(_files), max_args): output = call_program( - ['scanelf'] + params + files[i:i+max_args]).strip().split('\n') + ['scanelf'] + params + _files[i:i+max_args]).strip().split('\n') output = [x for x in output if x != ''] if output: out.extend(output) + print("SCAN(), final output length:", len(out)) return out -- cgit v1.2.3