This might be the wrong forum, but here goes.
I'm trying to use the rpm python api to get information out of the rpm database, specifically the type of information given with rpm -q --whatprovides. I've got a solution halfway working. The problem is figuring out the provider of files. The python query call:
Code:
import rpm
ts = rpm.TransactionSet()
headers = ts.dbMatch('providename', whatevercapabilityIwant)
gives me the header of the providing package when the capability is a package. But when the capability is a file path, headers is empty. I've tried doing:
Code:
baseheaders = ts.dbMatch('basenames', whateverthenameofthefileis)
dirheaders = ts.dbMatch('dirnames', whateverthenameofthedirectoryis)
Then matching the headers in both lists. Problem is, baseheaders and dirheaders are empty, regardless of the file I'm querying.
So, in conclusion, any ideas on how to mimic the rpm -q --whatprovides call? Or where else to ask this question?