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 1RCL3n-0007hc-Ll for garchives@archives.gentoo.org; Sat, 08 Oct 2011 00:46:40 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C04FD21C064; Sat, 8 Oct 2011 00:46:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8869121C064 for ; Sat, 8 Oct 2011 00:46:29 +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 2776C1B4034 for ; Sat, 8 Oct 2011 00:46:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 385C280042 for ; Sat, 8 Oct 2011 00:46:27 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <867d4048244e27cb269cf4dfeca98dad3e60da19.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:master commit in: scripts/ X-VCS-Repository: proj/elfix X-VCS-Files: scripts/revdep-pax X-VCS-Directories: scripts/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 867d4048244e27cb269cf4dfeca98dad3e60da19 Date: Sat, 8 Oct 2011 00:46: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: 9ca48412a27c07a9f24b60fe85e5ddde commit: 867d4048244e27cb269cf4dfeca98dad3e60da19 Author: Anthony G. Basile gentoo org> AuthorDate: Sat Oct 8 00:45:06 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Oct 8 00:45:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D867d4048 scripts/revdep-pax: fixed two bugs 1) We need to continue to the next pkg not break out of the loop when /var/db/pkg/cat/pkg/NEEDED is missing 2) print_forward_linkings needs so2filename_mappings to do its job --- scripts/revdep-pax | 29 ++++++++++++++++++++++++----- 1 files changed, 24 insertions(+), 5 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index 6a28a72..98a2985 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -12,6 +12,7 @@ def get_ldd_linkings(elf): #When subprocess.DEVNULL makes it to python, change this: http://bugs.= python.org/issue5870 ldd_output =3D subprocess.check_output(['/usr/bin/ldd', elf], stderr=3D= subprocess.PIPE) except: + # We should record these elfs which are probably static return [] ldd_lines =3D ldd_output.split('\n') linkings =3D [] @@ -54,7 +55,7 @@ def get_forward_linkings(): for m in mappings: so2filename_mappings[m[0]] =3D m[1] except: - break + continue =20 return ( forward_linkings, so2filename_mappings ) =20 @@ -104,7 +105,7 @@ def print_forward_linkings( forward_linkings, so2file= name_mappings ): print '\n\n' =20 =20 -def print_reverse_linkings( reverse_linkings ): +def print_reverse_linkings( reverse_linkings, so2filename_mappings ): missing_elfs =3D [] missing_links =3D [] for elf in reverse_linkings: @@ -152,11 +153,11 @@ def main(): usage() sys.exit(1) =20 + do_forward =3D False + do_reverse =3D False binary =3D None library =3D None =20 - do_forward =3D False - do_reverse =3D False =20 for o, a in opts: if o =3D=3D '-h': @@ -182,7 +183,25 @@ def main(): if do_reverse: ( forward_linkings, so2filename_mappings ) =3D get_forward_linkings() reverse_linkings =3D invert_linkings( forward_linkings ) - print_reverse_linkings( reverse_linkings ) + print_reverse_linkings( reverse_linkings, so2filename_mappings ) + + if binary !=3D None: + ( forward_linkings, so2filename_mappings ) =3D get_forward_linkings() + linkings =3D forward_linkings[binary] + print linkings + + """ + try: + filename =3D so2filename_mappings[binary] + flags =3D pax.getflags(filename) + print binary, '\t', filename, '(', flags, ')' + except: + print "%s doesn't link to anything that I know of" % binary + """ + + if library !=3DNone: + ( forward_linkings, so2filename_mappings ) =3D get_forward_linkings() + reverse_linkings =3D invert_linkings( forward_linkings ) =20 if __name__ =3D=3D '__main__': main()