From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qgkmb-0002FL-1U for garchives@archives.gentoo.org; Tue, 12 Jul 2011 21:46:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9E2E221C278; Tue, 12 Jul 2011 21:45:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5BFB421C277 for ; Tue, 12 Jul 2011 21:45:28 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 05CAA2AC05E for ; Tue, 12 Jul 2011 21:45:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6E46C8003E for ; Tue, 12 Jul 2011 21:45:27 +0000 (UTC) From: "Paul Varner" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paul Varner" Message-ID: <8d6b825b2d8e5eb69568619223721ae5c7e0aa07.fuzzyray@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 pym/gentoolkit/revdep_rebuild/collect.py pym/gentoolkit/revdep_rebuild/rebuild.py X-VCS-Directories: pym/gentoolkit/revdep_rebuild/ X-VCS-Committer: fuzzyray X-VCS-Committer-Name: Paul Varner X-VCS-Revision: 8d6b825b2d8e5eb69568619223721ae5c7e0aa07 Date: Tue, 12 Jul 2011 21:45:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: c0e961417dd977baf7996e4650b303fd commit: 8d6b825b2d8e5eb69568619223721ae5c7e0aa07 Author: Slawek gmail com> AuthorDate: Tue Apr 26 07:08:24 2011 +0000 Commit: Paul Varner gentoo org> CommitDate: Tue Jul 12 21:29:01 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3D8d6b825b Fixed .la files parser. Some minor logging fixes. --- pym/gentoolkit/revdep_rebuild/analyse.py | 23 ++++++++++++++++++----- pym/gentoolkit/revdep_rebuild/collect.py | 6 +++--- pym/gentoolkit/revdep_rebuild/rebuild.py | 4 ++-- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/pym/gentoolkit/revdep_rebuild/analyse.py b/pym/gentoolkit/re= vdep_rebuild/analyse.py index 521d8b9..be696d1 100644 --- a/pym/gentoolkit/revdep_rebuild/analyse.py +++ b/pym/gentoolkit/revdep_rebuild/analyse.py @@ -40,6 +40,15 @@ def prepare_checks(files_to_check, libraries, bits, cm= d_max_args): =20 def extract_dependencies_from_la(la, libraries, to_check, logger): broken =3D [] + + libnames =3D [] + for l in libraries: + m =3D re.match('.+\/(.+)\.(so|la|a)(\..+)?', l) + if m is not None: + ln =3D m.group(1) + if ln not in libnames: + libnames +=3D [ln, ] + for f in la: if not os.path.exists(f): continue @@ -51,10 +60,12 @@ def extract_dependencies_from_la(la, libraries, to_ch= eck, logger): if m is not None: for el in m.group(1).split(' '): el =3D el.strip() - if len(el) < 1 or el.startswith('-'): + if len(el) < 1 or el.startswith('-L'): continue =20 - 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: @@ -66,7 +77,7 @@ def extract_dependencies_from_la(la, libraries, to_chec= k, logger): if not _break: continue =20 - logger.info(yellow(' * ') + f + ' is broken (requires: ' + bold(e= l)) + logger.info(yellow(' * ') + f + ' is broken (requires: ' + bold(e= l)+')') broken.append(f) return broken =20 @@ -178,13 +189,15 @@ def analyse(settings, logger, libraries=3DNone, la_= libraries=3DNone, #call_program(['scanelf', '-M', str(bits), '-BF', '%F',] + libraries+l= ibraries_links).strip().split('\n') =20 found_libs, dependencies =3D prepare_checks(libs_and_bins, _libraries,= bits, settings['CMD_MAX_ARGS']) - + #print dependencies broken =3D find_broken(found_libs, _libraries, _libs_to_check) - broken_la =3D extract_dependencies_from_la(la_libraries, _libraries, _= libs_to_check, logger) =20 bits /=3D 2 bits =3D int(bits) =20 + broken_la =3D extract_dependencies_from_la(la_libraries, libraries+libr= aries_links, _libs_to_check, logger) + + broken_pathes =3D main_checks(found_libs, broken, dependencies, logger) broken_pathes +=3D broken_la =20 diff --git a/pym/gentoolkit/revdep_rebuild/collect.py b/pym/gentoolkit/re= vdep_rebuild/collect.py index b408edc..b7ed469 100644 --- a/pym/gentoolkit/revdep_rebuild/collect.py +++ b/pym/gentoolkit/revdep_rebuild/collect.py @@ -172,7 +172,7 @@ def collect_libraries_from_dir(dirs, mask, logger): prv & stat.S_IXOTH =3D=3D 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))) =20 =20 if found_directories: @@ -219,7 +219,7 @@ def collect_binaries_from_dir(dirs, mask, logger): prv & stat.S_IXOTH =3D=3D 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))) =20 if found_directories: found_files +=3D collect_binaries_from_dir(found_directories, mask, lo= gger) @@ -240,7 +240,7 @@ if __name__ =3D=3D '__main__': libraries, la_libraries, libraries_links, symlink_pairs =3D collect_lib= raries_from_dir(lib_dirs, masked_dirs, logging) binaries =3D collect_binaries_from_dir(bin_dirs, masked_dirs, logging) =20 - print 'Found: %i binaries and %i libraries.' %(len(binaries), len(libra= ries)) + logging.debug('Found: %i binaries and %i libraries.' %(len(binaries), l= en(libraries))) =20 =20 =20 diff --git a/pym/gentoolkit/revdep_rebuild/rebuild.py b/pym/gentoolkit/re= vdep_rebuild/rebuild.py index ef3a476..f77d98c 100644 --- a/pym/gentoolkit/revdep_rebuild/rebuild.py +++ b/pym/gentoolkit/revdep_rebuild/rebuild.py @@ -32,7 +32,7 @@ from settings import DEFAULTS =20 =20 APP_NAME =3D sys.argv[0] -VERSION =3D '0.1-r6' +VERSION =3D '0.1-r7' =20 __productname__ =3D "revdep-ng" =20 @@ -232,5 +232,5 @@ def main(settings=3DNone, logger=3DNone): 'again or manually emerge given packages.') =20 success =3D rebuild(logger, assigned, settings) - logger.debug("rebuild return code =3D", success) + logger.debug("rebuild return code =3D %i" %success) return success