summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-03-17 10:47:11 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2011-03-17 10:47:11 +0100
commite08e5ffa890706a949323efd8a18685c3e053eb0 (patch)
treedf7be6a5aafaf49136733c6afe5cae4ec86c0d5a /src
parent870d000f6f5c90447d54a0c18813c41c534401a9 (diff)
downloadabrt-e08e5ffa890706a949323efd8a18685c3e053eb0.tar.gz
abrt-e08e5ffa890706a949323efd8a18685c3e053eb0.tar.xz
abrt-e08e5ffa890706a949323efd8a18685c3e053eb0.zip
forgot to commit abrt-action-list-dsos.py
Diffstat (limited to 'src')
-rwxr-xr-xsrc/plugins/abrt-action-list-dsos.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/abrt-action-list-dsos.py b/src/plugins/abrt-action-list-dsos.py
new file mode 100755
index 00000000..a0e91d5a
--- /dev/null
+++ b/src/plugins/abrt-action-list-dsos.py
@@ -0,0 +1,23 @@
+#! /usr/bin/python -u
+import rpm
+
+def list_dsos_rpm(dso_paths):
+
+ ts = rpm.TransactionSet()
+ for path in dso_paths:
+ mi = ts.dbMatch('basenames', path)
+ if len(mi):
+ for h in mi:
+ print "%s <> %s - (%s)" % (path, h[rpm.RPMTAG_NEVRA], h[rpm.RPMTAG_VENDOR])
+ else:
+ print "%s doesn't belong to any package" % (path)
+
+
+def parse_maps(maps_path):
+ f = open(maps_path, "r")
+ return [x.strip()[x.find('/'):] for x in f.readlines() if x.find('/') > -1]
+
+
+if __name__ == "__main__":
+ dsos = parse_maps("maps")
+ list_dsos_rpm(dsos)