Added support for file path in -L option
authorSlawek <lis.slawek@gmail.com>
Wed, 27 Apr 2011 04:21:03 +0000 (06:21 +0200)
committerPaul Varner <fuzzyray@gentoo.org>
Tue, 12 Jul 2011 21:29:01 +0000 (16:29 -0500)
pym/gentoolkit/revdep_rebuild/analyse.py
pym/gentoolkit/revdep_rebuild/rebuild.py

index be696d14f34276260cd14f1b860920d3ed435caa..d94365edaabf3d0a76d2d258738fd523a74bf473 100644 (file)
@@ -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
index f77d98cfe3ebfe0a1efc4af12a7564a761d5da82..5385b0ed191c6c121f28bca397e926cfa7043640 100644 (file)
@@ -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