blob: 926a6b99c12cd3829af61def751c02e4ac8ed2a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/usr/bin/python
import rpm
def printresult (name, mi):
print name
h = mi.next()
while h:
print "\t%(name)s-%(version)s-%(release)s" % h
h = mi.next()
db = rpm.opendb(0)
printresult ('provides', db.match ('providename', 'libc.so.6.1'))
printresult ('requires', db.match ('requirename', 'libGL.so.1'))
# segfault
#printresult ('obsoletes', db.match ('obsoletes', 'gimp-data-min'))
printresult ('name', db.match ('name', 'gimp'))
printresult ('basenames', db.match ('basenames', '/etc/passwd'))
print db[db.findbyname ('gimp')[0]]['name']
|