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 1RCMGl-0000yJ-Ab for garchives@archives.gentoo.org; Sat, 08 Oct 2011 02:04:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3D84821C09C; Sat, 8 Oct 2011 02:03:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F03A021C09C for ; Sat, 8 Oct 2011 02:03:56 +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 747901B4034 for ; Sat, 8 Oct 2011 02:03:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9ED1F80042 for ; Sat, 8 Oct 2011 02:03:55 +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: <36e13b75a70b687561cba3cef219642e346e2ce6.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: 36e13b75a70b687561cba3cef219642e346e2ce6 Date: Sat, 8 Oct 2011 02:03:55 +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: 744dbbcf9614070ec1d57258658ac296 commit: 36e13b75a70b687561cba3cef219642e346e2ce6 Author: Anthony G. Basile gentoo org> AuthorDate: Sat Oct 8 02:01:44 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Oct 8 02:01:44 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D36e13b75 scripts/revdep-pax: completed four command line options -f all forward linkings from binary to their libraries -r all reverse linkings from libraries to binaries that consume them -b binary - forward mapping for given binary -s soname - reverse mapping for given library identified by soname --- scripts/revdep-pax | 40 ++++++++++++++++++++++++++-------------- 1 files changed, 26 insertions(+), 14 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index 98a2985..e91a964 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -143,7 +143,7 @@ def usage(): =20 def main(): try: - opts, args =3D getopt.getopt(sys.argv[1:], 'hfrb:l:') + opts, args =3D getopt.getopt(sys.argv[1:], 'hfrb:s:') except getopt.GetoptError, err: print str(err) # will print something like 'option -a not recognized' usage() @@ -156,7 +156,7 @@ def main(): do_forward =3D False do_reverse =3D False binary =3D None - library =3D None + soname =3D None =20 =20 for o, a in opts: @@ -169,8 +169,8 @@ def main(): do_reverse =3D True elif o =3D=3D '-b': binary =3D a - elif o =3D=3D '-l': - library =3D a + elif o =3D=3D '-s': + soname =3D a else: print 'Option included in getopt but not handled here!' usage() @@ -188,20 +188,32 @@ def main(): if binary !=3D None: ( forward_linkings, so2filename_mappings ) =3D get_forward_linkings() linkings =3D forward_linkings[binary] - print linkings =20 - """ - 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 - """ + flags =3D pax.getflags(binary) + print binary, '(', flags, ')' + for soname in linkings: + try: + filename =3D so2filename_mappings[soname] + flags =3D pax.getflags(filename) + print '\t', soname, '\t', filename, '(', flags, ')' + except: + print "file for soname %s not found" % soname =20 - if library !=3DNone: + if soname !=3DNone: ( forward_linkings, so2filename_mappings ) =3D get_forward_linkings() reverse_linkings =3D invert_linkings( forward_linkings ) + linkings =3D reverse_linkings[soname] + library =3D so2filename_mappings[soname] + + flags =3D pax.getflags(library) + print soname, '\t', library, '(', flags, ')' + for binary in linkings: + try: + flags =3D pax.getflags(binary) + print '\t', binary, '(', flags, ')' + except: + print "cannot obtain pax flags for %s" % binary + =20 if __name__ =3D=3D '__main__': main()