[Yum-devel] rpm dbpath and mock

seth vidal skvidal at linux.duke.edu
Wed Apr 19 12:06:53 UTC 2006


On Wed, 2006-04-19 at 07:48 -0400, Paul Nasrat wrote:
> 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']
> 

Why can't he just do:

import rpm
root=/path/to/chroot
ts = rpm.TransactionSet(root)
mi = ts.dbMatch()
for h in mi:
    print h['name']

why the macro addition?

-sv





More information about the Yum-devel mailing list