public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:elfix-0.2.x commit in: scripts/
Date: Sat,  8 Oct 2011 18:54:08 +0000 (UTC)	[thread overview]
Message-ID: <4c3d4391e72ef87793564a31cec20a32c7ce9b2f.blueness@gentoo> (raw)

commit:     4c3d4391e72ef87793564a31cec20a32c7ce9b2f
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  6 23:39:08 2011 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Oct  8 18:53:27 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=4c3d4391

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
 
-from os import listdir
-#from os import listdir, path
+import os
+import subprocess
 import re
-
 import pax
 
 
 def get_forward_linkings():
 	var_db_pkg = '/var/db/pkg'
 	forward_linkings = {}
-	for cat in listdir(var_db_pkg):
+	for cat in os.listdir(var_db_pkg):
 		catdir = '%s/%s' % (var_db_pkg, cat)
-		for pkg in listdir(catdir):
+		for pkg in os.listdir(catdir):
 			pkgdir = '%s/%s' % (catdir, pkg)
 			need = '%s/%s' % (pkgdir, 'NEEDED')
 			try:
@@ -43,8 +42,26 @@ def invert_linkings( forward_linkings ):
 	return reverse_linkings 
 
 
+def get_soname2file_mappings():
+	ldconfig_output = subprocess.check_output(["/sbin/ldconfig", "-p"])
+	ldconfig_lines = ldconfig_output.split('\n')
+	ldconfig_lines.pop(0)			#first line is a header
+	ldconfig_lines.pop()				#last line empty because of previous split
+	mappings = {}
+	for m in range(0,len(ldconfig_lines)):
+		ldconfig_lines[m] = ldconfig_lines[m].strip()
+		mapp = re.split('=>', ldconfig_lines[m] )
+		soname = re.sub('\(.*$', '', mapp[0]).strip()
+		abi = re.search('\(.+\)', mapp[0]).group(0)
+		abi = abi.strip().strip('(').strip(')').strip()
+		filename = mapp[1].strip()
+		filename =  os.path.realpath(filename)
+		mappings[soname] = [ filename, pax.getflags(filename), abi ]
+	return mappings 
+
 forward_linkings = get_forward_linkings()
 reverse_linkings = invert_linkings( forward_linkings )
+soname2file_mappings = get_soname2file_mappings()
 
 
 """ 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]
 
 raw_input()
 
@@ -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]



             reply	other threads:[~2011-10-08 18:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-08 18:54 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-10-17 21:09 [gentoo-commits] proj/elfix:elfix-0.2.x commit in: scripts/ Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-17 21:09 Anthony G. Basile
2011-10-12 10:49 Anthony G. Basile
2011-10-12 10:48 Anthony G. Basile
2011-10-12 10:48 Anthony G. Basile
2011-10-12 10:47 Anthony G. Basile
2011-10-12 10:47 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile
2011-10-08 18:54 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c3d4391e72ef87793564a31cec20a32c7ce9b2f.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox