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 1RBxX8-0003IY-J2 for garchives@archives.gentoo.org; Thu, 06 Oct 2011 23:39:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D1E3C21C038; Thu, 6 Oct 2011 23:39:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9A83A21C038 for ; Thu, 6 Oct 2011 23:39:14 +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 211261B4041 for ; Thu, 6 Oct 2011 23:39:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2B7E480042 for ; Thu, 6 Oct 2011 23:39:13 +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: <81ae64185b7a145f81c92d1663dc459aae45c6a5.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: 81ae64185b7a145f81c92d1663dc459aae45c6a5 Date: Thu, 6 Oct 2011 23:39:13 +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: 88cd8d6786f7fcf85c48cf0df49f06a0 commit: 81ae64185b7a145f81c92d1663dc459aae45c6a5 Author: Anthony G. Basile gentoo org> AuthorDate: Thu Oct 6 23:39:08 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Thu Oct 6 23:39:08 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D81ae6418 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]