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 1RCc3c-0004s6-MX for garchives@archives.gentoo.org; Sat, 08 Oct 2011 18:55:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C644421C253; Sat, 8 Oct 2011 18:54:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9514121C24A for ; Sat, 8 Oct 2011 18:54:09 +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 4EF921B402F for ; Sat, 8 Oct 2011 18:54:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9C64C80056 for ; Sat, 8 Oct 2011 18:54:08 +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: <4c3d4391e72ef87793564a31cec20a32c7ce9b2f.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:elfix-0.2.x 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: 4c3d4391e72ef87793564a31cec20a32c7ce9b2f Date: Sat, 8 Oct 2011 18:54:08 +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: de9f36704d520a476e7fa08c47c2f3e8 commit: 4c3d4391e72ef87793564a31cec20a32c7ce9b2f Author: Anthony G. Basile gentoo org> AuthorDate: Thu Oct 6 23:39:08 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Oct 8 18:53:27 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D4c3d4391 scripts/revdep-pax: add soname to real file mappings --- scripts/revdep-pax | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index 697a41d..4873518 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -1,18 +1,17 @@ #!/usr/bin/env python =20 -from os import listdir -#from os import listdir, path +import os +import subprocess import re - import pax =20 =20 def get_forward_linkings(): var_db_pkg =3D '/var/db/pkg' forward_linkings =3D {} - for cat in listdir(var_db_pkg): + for cat in os.listdir(var_db_pkg): catdir =3D '%s/%s' % (var_db_pkg, cat) - for pkg in listdir(catdir): + for pkg in os.listdir(catdir): pkgdir =3D '%s/%s' % (catdir, pkg) need =3D '%s/%s' % (pkgdir, 'NEEDED') try: @@ -43,8 +42,26 @@ def invert_linkings( forward_linkings ): return reverse_linkings=20 =20 =20 +def get_soname2file_mappings(): + ldconfig_output =3D subprocess.check_output(["/sbin/ldconfig", "-p"]) + ldconfig_lines =3D ldconfig_output.split('\n') + ldconfig_lines.pop(0) #first line is a header + ldconfig_lines.pop() #last line empty because of previous split + mappings =3D {} + for m in range(0,len(ldconfig_lines)): + ldconfig_lines[m] =3D ldconfig_lines[m].strip() + mapp =3D re.split('=3D>', ldconfig_lines[m] ) + soname =3D re.sub('\(.*$', '', mapp[0]).strip() + abi =3D re.search('\(.+\)', mapp[0]).group(0) + abi =3D abi.strip().strip('(').strip(')').strip() + filename =3D mapp[1].strip() + filename =3D os.path.realpath(filename) + mappings[soname] =3D [ filename, pax.getflags(filename), abi ] + return mappings=20 + forward_linkings =3D get_forward_linkings() reverse_linkings =3D invert_linkings( forward_linkings ) +soname2file_mappings =3D get_soname2file_mappings() =20 =20 """ Print out mapping: binary -> library, library, library ... """ @@ -52,6 +69,7 @@ for elf in forward_linkings: print elf for elf_dep in forward_linkings[elf]: print "\t", elf_dep + #print "\t\t", soname2file_mappings[elf_dep] =20 raw_input() =20 @@ -62,3 +80,7 @@ for elf_dep in reverse_linkings: print "\t", elf #if not path.exists(elf): # print "%s doesn't exist!" % elf +raw_input() + +for s in soname2file_mappings: + print s, soname2file_mappings[s]