#!/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)