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 1RBdZU-0001qy-Lk for garchives@archives.gentoo.org; Thu, 06 Oct 2011 02:20:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 148D821C061; Thu, 6 Oct 2011 02:20:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D01A321C061 for ; Thu, 6 Oct 2011 02:20:20 +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 B9C2D1B4040 for ; Thu, 6 Oct 2011 02:20:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A88A080042 for ; Thu, 6 Oct 2011 02:20:18 +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: <320f445deb14ed5c7596d33eae43a03dff988e3a.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: 320f445deb14ed5c7596d33eae43a03dff988e3a Date: Thu, 6 Oct 2011 02:20:18 +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: 93830339981a4cdb02738ca4a86c46b4 commit: 320f445deb14ed5c7596d33eae43a03dff988e3a Author: Anthony G. Basile gentoo org> AuthorDate: Thu Oct 6 02:20:09 2011 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Thu Oct 6 02:20:09 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/elfix.git;a=3D= commit;h=3D320f445d scripts/revdep-pax: python rewrite of revdep-paxmark --- scripts/revdep-pax | 53 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/scripts/revdep-pax b/scripts/revdep-pax new file mode 100755 index 0000000..75e833a --- /dev/null +++ b/scripts/revdep-pax @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +from os import listdir +#from os import path +import re + +var_db_pkg =3D '/var/db/pkg' + +binaries =3D {} +for cat in listdir(var_db_pkg): + catdir =3D '%s/%s' % (var_db_pkg, cat) + for pkg in listdir(catdir): + pkgdir =3D '%s/%s' % (catdir, pkg) + need =3D '%s/%s' % (pkgdir, 'NEEDED') + try: + g =3D open(need, 'r') + needs =3D g.readlines() + for line in needs: + line =3D line.strip() + linking =3D re.split('\s', line) + binary =3D linking[0] + print binary + library_list =3D re.split(',', linking[1]) + binaries[binary] =3D library_list + except: + break + +""" Print out mapping: binary -> library, library, library ... +for binary in binaries: + print binary + for library in binaries[binary]: + print "\t", library +""" + +libraries =3D {} +for binary in binaries: + for library in binaries[binary]: + libraries[library] =3D [] + +for binary in binaries: + for library in binaries[binary]: + libraries[library].append(binary) + +""" Print out mapping: library -> binary, binary, binary ... +for library in libraries: + print library + for binary in libraries[library]: + print "\t", binary + #if not path.exists(binary): + # print "%s doesn't exist!" % binary +""" + +