RPM Community Forums

Mailing List Message of <rpm-users>

Re: rpm dependency checking via python

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 08 May 2010 - 17:38:04 CEST
Message-id: <628071BB-6E3F-4539-B162-AF52DEC5B3BE@mac.com>

On May 8, 2010, at 10:26 AM, Jeff Johnson wrote:

> On May 8, 2010, at 9:15 AM, я▌я─п╨п╟ п╬п╩п╣п╧п╫п╦п╨п╬п╡ wrote:
>> how do i check in python if rpmA has satisfied dependecies from rpmB if i do not want to use rpmdb?
> If you don't want to use an rpmdb, then you cannot check "added"
> dependency assertions against "installed" packages. An rpmdb
> is in fact where the "installed" package metadata lives.

The specific answer to your question (assuming you don't
care whatsoever about "installed" package dependencies) is

1) Get a transaction

2) (counter intuitively) close the rpmdb using the ts.closedb() method.

3) add headers to the transaction as if you were going to install.

4) call the ts.check() method, and retrieve the dependency failures.

What I believe you are going to find is that there are many
failed "installed" dependency assertions that are normally satisfied 
by information contained in an rpmdb.

To fix _THAT_ problem, just don't do step 2) let the transaction
access an rpmdb as needed.


73 de Jeff
Received on Sat May 8 17:38:32 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.