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