def extract_dependencies_from_la(la, libraries, to_check, logger):
broken = []
+
+ libnames = []
+ for l in libraries:
+ m = re.match('.+\/(.+)\.(so|la|a)(\..+)?', l)
+ if m is not None:
+ ln = m.group(1)
+ if ln not in libnames:
+ libnames += [ln, ]
+
for f in la:
if not os.path.exists(f):
continue
if m is not None:
for el in m.group(1).split(' '):
el = el.strip()
- if len(el) < 1 or el.startswith('-'):
+ if len(el) < 1 or el.startswith('-L'):
continue
- if el in la or el in libraries:
+ if el.startswith('-l') and 'lib'+el[2:] in libnames:
+ pass
+ elif el in la or el in libraries:
pass
else:
if to_check:
if not _break:
continue
- logger.info(yellow(' * ') + f + ' is broken (requires: ' + bold(el))
+ logger.info(yellow(' * ') + f + ' is broken (requires: ' + bold(el)+')')
broken.append(f)
return broken
#call_program(['scanelf', '-M', str(bits), '-BF', '%F',] + libraries+libraries_links).strip().split('\n')
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)
- broken_la = extract_dependencies_from_la(la_libraries, _libraries, _libs_to_check, logger)
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
prv & stat.S_IXOTH == stat.S_IXOTH:
found_files.append(l)
except Exception as ex:
- logger.debug(yellow('Exception during collecting libraries: %s' %str(ex)))
+ logger.debug(yellow('Exception during collecting libraries: ' + blue('%s') %str(ex)))
if found_directories:
prv & stat.S_IXOTH == stat.S_IXOTH:
found_files.append(l)
except Exception as e:
- logger.debug(yellow('Exception during binaries collecting: %s' %str(e)))
+ logger.debug(yellow('Exception during binaries collecting: '+blue('%s') %str(e)))
if found_directories:
found_files += collect_binaries_from_dir(found_directories, mask, logger)
libraries, la_libraries, libraries_links, symlink_pairs = collect_libraries_from_dir(lib_dirs, masked_dirs, logging)
binaries = collect_binaries_from_dir(bin_dirs, masked_dirs, logging)
- print 'Found: %i binaries and %i libraries.' %(len(binaries), len(libraries))
+ logging.debug('Found: %i binaries and %i libraries.' %(len(binaries), len(libraries)))
APP_NAME = sys.argv[0]
-VERSION = '0.1-r6'
+VERSION = '0.1-r7'
__productname__ = "revdep-ng"
'again or manually emerge given packages.')
success = rebuild(logger, assigned, settings)
- logger.debug("rebuild return code =", success)
+ logger.debug("rebuild return code = %i" %success)
return success