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.7.x commit in: misc/
Date: Sat, 29 Dec 2012 01:16:09 +0000 (UTC)	[thread overview]
Message-ID: <1356743322.fde0fdf864aac2291787d2b6c8a77f84b66d4297.blueness@gentoo> (raw)

commit:     fde0fdf864aac2291787d2b6c8a77f84b66d4297
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 26 21:43:20 2012 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Dec 29 01:08:42 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=fde0fdf8

misc/link_map.py: place class in its own module

---
 misc/{link_maps => link_map.py} |   61 +++++++++++----------------------------
 misc/link_map_test              |   61 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 44 deletions(-)

diff --git a/misc/link_maps b/misc/link_map.py
similarity index 83%
rename from misc/link_maps
rename to misc/link_map.py
index 508af24..5b0e822 100755
--- a/misc/link_maps
+++ b/misc/link_map.py
@@ -1,12 +1,24 @@
 #!/usr/bin/env python
+#
+#    LinkMap.py: this file is part of the elfix package
+#    Copyright (C) 2011  Anthony G. Basile
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-import os
-import sys
 import re
-import pax
 import portage
 
-
 class LinkMap:
 
     def __init__(self):
@@ -22,6 +34,7 @@ class LinkMap:
 
         See /usr/lib/portage/bin/misc-functions.sh ~line 520
         """
+
         vardb = portage.db[portage.root]["vartree"].dbapi
 
         self.pkgs = []
@@ -183,43 +196,3 @@ class LinkMap:
 
         return ( object_linkings, object_reverse_linkings, library2soname, soname2library )
 
-
-def main():
-
-    # Run as root to be able to real all files
-    uid = os.getuid()
-    if uid != 0:
-        print('RUN AS ROOT: cannot read all flags')
-        sys.exit(0)
-
-    link_maps = LinkMap()
-    ( object_linkings, object_reverse_linkings, library2soname, soname2library ) = link_maps.get_maps()
-
-    layout = "{0:<30} => {1:<30}"
-
-    #Print out all ELF objects and the NEEDED sonames and full library paths
-    for abi in object_linkings:
-        for elf in object_linkings[abi]:
-            sonames = object_linkings[abi][elf]
-            print('%s: %s' % (abi,elf))
-            for soname in sorted(object_linkings[abi][elf]):
-                try:
-                    print('\t%s' % layout.format(soname, soname2library[(soname,abi)]))
-                except KeyError:
-                    print('\t%s' % layout.format(soname, '***' ))
-            print('')
-
-    # Print out all ELF objects and the NEEDED sonames and full library paths
-    for abi in object_linkings:
-        for soname in object_reverse_linkings[abi]:
-            try:
-                print('%s: %s' % (abi, layout.format(soname, soname2library[(soname,abi)])))
-            except KeyError:
-                print('%s: %s' % (abi, layout.format(soname, '***' )))
-            for elf in sorted(object_reverse_linkings[abi][soname]):
-                print('\t%s' % elf)
-            print('')
-
-
-if __name__ == '__main__':
-    main()

diff --git a/misc/link_map_test b/misc/link_map_test
new file mode 100755
index 0000000..9a1af8e
--- /dev/null
+++ b/misc/link_map_test
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+#
+#    link_map_test: this file is part of the elfix package
+#    Copyright (C) 2011  Anthony G. Basile
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import sys
+from link_map import LinkMap
+
+def main():
+
+    # Run as root to be able to real all files
+    uid = os.getuid()
+    if uid != 0:
+        print('RUN AS ROOT: cannot read all flags')
+        sys.exit(0)
+
+    link_map = LinkMap()
+    ( object_linkings, object_reverse_linkings, library2soname, soname2library ) = link_map.get_maps()
+
+    layout = "{0:<30} => {1:<30}"
+
+    #Print out all ELF objects and the NEEDED sonames and full library paths
+    for abi in object_linkings:
+        for elf in object_linkings[abi]:
+            sonames = object_linkings[abi][elf]
+            print('%s: %s' % (abi,elf))
+            for soname in sorted(object_linkings[abi][elf]):
+                try:
+                    print('\t%s' % layout.format(soname, soname2library[(soname,abi)]))
+                except KeyError:
+                    print('\t%s' % layout.format(soname, '***' ))
+            print('')
+
+    # Print out all ELF objects and the NEEDED sonames and full library paths
+    for abi in object_linkings:
+        for soname in object_reverse_linkings[abi]:
+            try:
+                print('%s: %s' % (abi, layout.format(soname, soname2library[(soname,abi)])))
+            except KeyError:
+                print('%s: %s' % (abi, layout.format(soname, '***' )))
+            for elf in sorted(object_reverse_linkings[abi][soname]):
+                print('\t%s' % elf)
+            print('')
+
+
+if __name__ == '__main__':
+    main()


             reply	other threads:[~2012-12-29  1:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-29  1:16 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-12-29  1:29 [gentoo-commits] proj/elfix:elfix-0.7.x commit in: misc/ Anthony G. Basile
2012-12-29  1:16 Anthony G. Basile
2012-12-29  1:16 Anthony G. Basile
2012-12-29  1:16 Anthony G. Basile
2012-12-29  1:16 Anthony G. Basile
2012-12-29  1:16 Anthony G. Basile
2012-12-29  1:16 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 Anthony G. Basile
2012-12-24 10:59 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=1356743322.fde0fdf864aac2291787d2b6c8a77f84b66d4297.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