summaryrefslogtreecommitdiffstats
path: root/rpmmodule/t
blob: 777dd62ea493c4fc82037ed6aac2d0e7ff33c2f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/python

import rpm
import os

db = rpm.opendb()

for n in db.findbyprovides('libc.so.6'):
     print "match:", db[n]['name']

for n in db.findbyname('glibc'):
     print "match:", db[n]['name']

for n in db.findbyfile('/bin/bash'):
     print "match:", db[n]['name']

key = db.firstkey()
while key:
	print "got:", db[key]['name']
	
	key = db.nextkey(key)