setting root in python script

James Antill james at fedoraproject.org
Thu Apr 30 14:38:14 UTC 2020


On Thu, 2020-04-30 at 16:28 +0200, Miroslav Suchý wrote:
> Hi,
> I have this python code:
> 
> import rpm
> trans = rpm.TransactionSet()
> packages = [trans.dbMatch()]

 You probably want to set the go faster flags (see 
http://yum.baseurl.org/wiki/YumCodeSnippet/ListInstalledPkgs.html)

> But now, I want to support --root option in my script and allow to
> use different root.

root="/tmp/mychroot"
trans = rpm.TransactionSet(root)




More information about the Rpm-list mailing list