RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/rpmdb/ rpmdb.c

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 27 Aug 2008 - 16:10:30 CEST
Message-id: <54CF9DBF-298C-489C-8940-D8E50AE5AD1F@mac.com>

On Aug 27, 2008, at 9:48 AM, Jeff Johnson wrote:

> I see you've discovered the RPMDBI_LABLE hackery ;-)
>

Apologies, I should be more helpful.

Berkeley DB has a concept of a partial match during
a retrieve that might be used against the RPMTAG_NVRA
index instead of the RPMDB_LABEL repeated accesses
of the parsed primary key tuple.

Here's the define from db.h that gets set in DBT flags:

#define DB_DBT_PARTIAL          0x020   /* Partial put/get. */

(aside) The best implementation would be to use a proper database join
operation on multiple RPMTAG_{NAME,VERSION,RELEASE,ARCH,....}
data items. But there's a lot of release engineering that would be  
needed to
coax lusers into typing --rebuilddb in order to create the new indices.

Concatenating the tuple values into a RPMTAG_NVRA index and
using a partial string match might help eliminate RPMDBI_LABEL
however.

Note that concatenating the tuple elements confuses these package
labels:

Pkg1 has
    Name: foo
    Version: bar

Pkg2 has
    Name: foo-bar

which DBI_LABEL handles by parsing from the end of the string,
using the rule
     Neither Version: or Release: contain '-' characters.

I've never been able to figger a pleasing implementation for  
DB_DBT_PARTIAL,
but haven't looked for quite some time now.

hth

73 de Jeff
Received on Wed Aug 27 16:12:06 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.