[Yum-devel] rpm dbpath and mock

Paul Nasrat pnasrat at redhat.com
Wed Apr 19 11:48:55 UTC 2006


On Wed, 2006-04-19 at 20:03 +1000, Alan Milligan wrote:
> Hi,
> 
> I'm converting our build server to use mock and chroot.  One of the
> things I now need is to get rpm query info from the mock chroot instead
> of /var/lib/rpm.
> 
> The rpm commandline gives me --dbpath and --root to do this, but I
> cannot find an equivalent in rpm.TransactionSet() which only allows me
> to set the root.

import rpm
rpm.addMacro('_dbpath','/home/gnome/rpmdb')
myts = rpm.ts()
myts.openDB()
# Restore orignal
rpm.delMacro('_dbpath')
mi = ts.dbMatch()
for h in mi:
   print h['name']

Paul




More information about the Yum-devel mailing list