From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7AB9C138CEF for ; Tue, 11 Feb 2014 08:40:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 82D8BE0DEE; Tue, 11 Feb 2014 08:40:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 60E6BE0DA2 for ; Tue, 11 Feb 2014 08:40:14 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CD48533F919 for ; Tue, 11 Feb 2014 08:40:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 8BEB91888F for ; Tue, 11 Feb 2014 08:40:10 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1392106086.1ef7ee6bde1b12946471db650f27d0b0de9226e5.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/revdep_rebuild/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/revdep_rebuild/analyse.py X-VCS-Directories: pym/gentoolkit/revdep_rebuild/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 1ef7ee6bde1b12946471db650f27d0b0de9226e5 X-VCS-Branch: gentoolkit Date: Tue, 11 Feb 2014 08:40:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 18cd051d-9a6b-496a-921c-bd5a8a20d663 X-Archives-Hash: eb637894917a17505ef289a9d05e9eec commit: 1ef7ee6bde1b12946471db650f27d0b0de9226e5 Author: Brian Dolbec gentoo org> AuthorDate: Tue Feb 11 03:34:45 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Feb 11 08:08:06 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=1ef7ee6b revdep_rebuild/analyse.py: Remove unused or commented out code --- pym/gentoolkit/revdep_rebuild/analyse.py | 132 ------------------------------- 1 file changed, 132 deletions(-) diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py index 9cee906..e2e1edd 100644 --- a/pym/gentoolkit/revdep_rebuild/analyse.py +++ b/pym/gentoolkit/revdep_rebuild/analyse.py @@ -16,43 +16,6 @@ from .assign import assign_packages from .cache import save_cache -def prepare_checks(files_to_check, libraries, bits, cmd_max_args): - ''' Calls scanelf for all files_to_check, - then returns found libraries and dependencies - ''' - - # libs found by scanelf - libs = [] - # list of lists of files (from file_to_check) that uses - # library (for dependencies[id] and libs[id] => id==id) - dependencies = [] - - bits = [] - - -# from runner import ScanRunner -# sr = ScanRunner(['-M', str(bits), '-nBF', '%F %n'], files_to_check, cmd_max_args) -# sr.wait() - - for line in scan(['-M', str(bits), '-nBF', '%F %n %M'], files_to_check, cmd_max_args): - #call_program(['scanelf', '-M', str(bits), '-nBF', '%F %n',]+files_to_check).strip().split('\n'): - r = line.strip().split(' ') - if len(r) < 2: # no dependencies? - continue - - deps = r[1].split(',') - for d in deps: - if d in libs: - i = libs.index(d) - dependencies[i].append(r[0]) - else: - #print d, 'bits:', r[2][8:] # 8: -> strlen('ELFCLASS') - libs.append(d) - dependencies.append([r[0],]) - - return (libs, dependencies) - - def scan_files(libs_and_bins, cmd_max_args): scanned_files = {} # {bits: {soname: (filename, needed), ...}, ...} @@ -125,32 +88,6 @@ def extract_dependencies_from_la(la, libraries, to_check, logger): return broken -def find_broken(found_libs, system_libraries, to_check): - ''' Search for broken libraries. - Check if system_libraries contains found_libs, where - system_libraries is list of obsolute pathes and found_libs - is list of library names. - ''' - - # join libraries and looking at it as string - # is way faster than for-jumping - - broken = [] - syslibs = '|'.join(system_libraries) - - if not to_check: - for found in found_libs: - if found + '|' not in syslibs: - broken.append(found_libs.index(found)) - else: - for tc in to_check: - for found in found_libs: - if tc in found:# and found+'|' not in syslibs: - broken.append(found_libs.index(found)) - - return broken - - def find_broken2(scanned_files, logger): broken_libs = {} for bits, libs in scanned_files.items(): @@ -170,24 +107,6 @@ def find_broken2(scanned_files, logger): return broken_libs -def main_checks(found_libs, broken_list, dependencies, logger): - ''' Checks for broken dependencies. - found_libs have to be the same as returned by prepare_checks - broken_list is list of libraries found by scanelf - dependencies is the value returned by prepare_checks - ''' - - broken_pathes = [] - - for broken in broken_list: - found = found_libs[broken] - logger.info('Broken files that requires: ' + bold(found)) - for dep_path in dependencies[broken]: - logger.info(yellow(' * ') + dep_path) - broken_pathes.append(dep_path) - return broken_pathes - - def main_checks2(broken, scanned_files, logger): broken_pathes = [] for bits, _broken in broken.items(): @@ -275,57 +194,6 @@ def analyse(settings, logger, libraries=None, la_libraries=None, return assign_packages(broken_pathes, logger, settings) - #import sys - #sys.exit() - - #l = [] - #for line in call_program(['scanelf', '-M', '64', '-BF', '%F',] + libraries).strip().split('\n'): - #l.append(line) - #libraries = l - - ## old version from here - #found_libs = [] - #dependencies = [] - - #if _libs_to_check: - #nltc = [] - #for ltc in _libs_to_check: - #if os.path.isfile(ltc): - #ltc = scan(['-nBSF', '%S'], [ltc,], settings['CMD_MAX_ARGS'])[0].split()[0] - #nltc += [ltc,] - #_libs_to_check = nltc - - #_bits, linkg = platform.architecture() - #if _bits.startswith('32'): - #bits = 32 - #elif _bits.startswith('64'): - #bits = 64 - - #import time - #broken = [] - #for av_bits in glob.glob('/lib[0-9]*') or ('/lib32',): - #bits = int(av_bits[4:]) - - ##_libraries = scan(['-M', str(bits), '-BF', '%F'], libraries+libraries_links, settings['CMD_MAX_ARGS']) - #_libraries = libraries+libraries_links - - #found_libs, dependencies = prepare_checks(libs_and_bins, _libraries, bits, settings['CMD_MAX_ARGS']) - #broken = find_broken(found_libs, _libraries, _libs_to_check) - - #bits /= 2 - #bits = int(bits) - - #broken_la = extract_dependencies_from_la(la_libraries, libraries+libraries_links, _libs_to_check, logger) - - - #broken_pathes = main_checks(found_libs, broken, dependencies, logger) - #broken_pathes += broken_la - - #logger.warn(green(' * ') + bold('Assign files to packages')) - - #return assign_packages(broken_pathes, logger, settings) - - if __name__ == '__main__': print("This script shouldn't be called directly")