RPM Community Forums

Mailing List Message of <rpm-devel>

Re: selecting a package by "fullname"

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 20 Dec 2007 - 02:06:50 CET
Message-Id: <E341A782-E1D4-4AF1-94A4-A50809D9404D@mac.com>

On Dec 19, 2007, at 5:27 PM, Pazzo Da Legare wrote:

> Dear All,
>
> given a package with full name <Name>-<Version>-<Release>
> how can I match the package header by fullname (not only) and not
> using only the <Name> and  iterate on the result using
> "rpmtsInitIterator(ts, RPMTAG_NAME, <Name>, 0)"?
>

Use an iterator on RPMDBI_LABEL is one approach.

Using primary retrieval on RPMTAG_NAME with 2ndary explicit filtering on
RPMTAG_VERSION and RPMTAG_RELEASE within your iteration
loop is another approach.

Primary retrieval on RPMTAG_NAME with implicit pattern matches on  
RPMTAG_VERSION
and RPMTAG_RELEASE using rpmdbSetIteratorRE() is a 3rd approach.

The approaches are all basically identical in the sense that
the same comparison operations are performed.

73 de Jeff
Received on Thu Dec 20 02:07:05 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.