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 1RCc3X-0004qJ-HJ for garchives@archives.gentoo.org; Sat, 08 Oct 2011 18:55:31 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A770921C24B; 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 65DDD21C24B 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 21BED1B4016 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 70AB880042 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: <2abc34b0c8c5774351d492c572db652acf2313bd.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: 2abc34b0c8c5774351d492c572db652acf2313bd 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: b7385f75441a26368ddd61a14579ed21 commit: 2abc34b0c8c5774351d492c572db652acf2313bd Author: Anthony G. Basile gentoo org> AuthorDate: Thu Oct 6 20:14:11 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=3D2abc34b0 scripts/revdep-pax: improved variable names --- scripts/revdep-pax | 63 ++++++++++++++++++++++++++--------------------= ----- 1 files changed, 32 insertions(+), 31 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax index df78e35..697a41d 100755 --- a/scripts/revdep-pax +++ b/scripts/revdep-pax @@ -7,9 +7,9 @@ import re import pax =20 =20 -def forward_linkings(): +def get_forward_linkings(): var_db_pkg =3D '/var/db/pkg' - elf_objects =3D {} + forward_linkings =3D {} for cat in listdir(var_db_pkg): catdir =3D '%s/%s' % (var_db_pkg, cat) for pkg in listdir(catdir): @@ -20,44 +20,45 @@ def forward_linkings(): needs =3D g.readlines() for line in needs: line =3D line.strip() - linking =3D re.split('\s', line) - elf =3D linking[0] - elf_deps =3D re.split(',', linking[1]) - elf_objects[elf] =3D elf_deps=20 + link =3D re.split('\s', line) + elf =3D link[0] + linkings =3D re.split(',', link[1]) + forward_linkings[elf] =3D linkings=20 except: break =20 - return elf_objects=20 + return forward_linkings=20 =20 =20 -def reverse_linkings( binaries ): - libraries =3D {} - for binary in binaries: - for library in binaries[binary]: - libraries[library] =3D [] +def invert_linkings( forward_linkings ): + reverse_linkings =3D {} + for elf in forward_linkings: + for elf_dep in forward_linkings[elf]: + reverse_linkings[elf_dep] =3D [] =20 - for binary in binaries: - for library in binaries[binary]: - libraries[library].append(binary) + for elf in forward_linkings: + for elf_dep in forward_linkings[elf]: + reverse_linkings[elf_dep].append(elf) =20 - return libraries + return reverse_linkings=20 =20 =20 -elf_objects =3D forward_linkings() -elf_deps =3D reverse_linkings( elf_objects ) +forward_linkings =3D get_forward_linkings() +reverse_linkings =3D invert_linkings( forward_linkings ) =20 -""" Print out mapping: binary -> library, library, library ... -for elf in elf_objects: - print elf - for elf_deps in elf_objects[elf]: - print "\t", elf_deps -""" =20 -""" Print out mapping: library -> binary, binary, binary ... -for elf in elf_deps: +""" Print out mapping: binary -> library, library, library ... """ +for elf in forward_linkings: print elf - for elf_object in elf_deps[elf]: - print "\t", elf_object - #if not path.exists(binary): - # print "%s doesn't exist!" % binary -""" + for elf_dep in forward_linkings[elf]: + print "\t", elf_dep + +raw_input() + +""" Print out mapping: library -> binary, binary, binary ... """ +for elf_dep in reverse_linkings: + print elf_dep + for elf in reverse_linkings[elf_dep]: + print "\t", elf + #if not path.exists(elf): + # print "%s doesn't exist!" % elf