setting root in python script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I have this python code:

import rpm
trans = rpm.TransactionSet()
packages = [trans.dbMatch()]

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

I found in
https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch16s03.html#id619811
that I can override `_dbpath` macro. But that requires from me to doing:
  root + `/var/lib/rpm`
and I would like to get rid of that plus part (i.e. do not maintain the path inside of that changed root).

Can you please give me guidance what is the recommended way to do this?

-- 
Miroslav Suchy, RHCA
Red Hat, Associate Manager ABRT/Copr, #brno, #fedora-buildsys

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list



[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux