From: Slawek Date: Wed, 27 Apr 2011 04:21:03 +0000 (+0200) Subject: Added support for file path in -L option X-Git-Tag: gentoolkit-0.3.0.5~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c7d95a92e5ec1b12f15536866bb05a77eae7e466;p=gentoolkit.git Added support for file path in -L option --- diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/revdep_rebuild/analyse.py index be696d1..d94365e 100644 --- a/pym/gentoolkit/revdep_rebuild/analyse.py +++ b/pym/gentoolkit/revdep_rebuild/analyse.py @@ -35,6 +35,7 @@ def prepare_checks(files_to_check, libraries, bits, cmd_max_args): else: libs.append(d) dependencies.append([r[0],]) + return (libs, dependencies) @@ -176,6 +177,13 @@ def analyse(settings, logger, libraries=None, la_libraries=None, 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'): @@ -183,13 +191,15 @@ def analyse(settings, logger, libraries=None, la_libraries=None, 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']) - #call_program(['scanelf', '-M', str(bits), '-BF', '%F',] + libraries+libraries_links).strip().split('\n') + + #_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']) - #print dependencies broken = find_broken(found_libs, _libraries, _libs_to_check) bits /= 2 diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/revdep_rebuild/rebuild.py index f77d98c..5385b0e 100644 --- a/pym/gentoolkit/revdep_rebuild/rebuild.py +++ b/pym/gentoolkit/revdep_rebuild/rebuild.py @@ -92,6 +92,9 @@ def init_logger(settings): def parse_options(): """Parses the command line options an sets settings accordingly""" + # @TODO: Verify: options: no-ld-path, no-order, no-progress are not appliable + # for revdep-ng + settings = DEFAULTS.copy() try: opts, args = getopt.getopt(sys.argv[1:], @@ -155,11 +158,11 @@ def rebuild(logger, assigned, settings): logger.warn(bold('\nThere is nothing to emerge. Exiting.')) return 0 - emerge_command = args + ' --oneshot ' + emerge_command + emerge_command = emerge_command - logger.warn(yellow('\nemerge') + bold(emerge_command)) + logger.warn(yellow('\nemerge') + args + ' --oneshot ' + bold(emerge_command)) - success = os.system('emerge ' + emerge_command) + success = os.system('emerge ' + args + ' --oneshot ' + emerge_command) return success